dll_entry [was Re: fork expert needed: (was .....])

Trevor Forbes trevorforbes@ozemail.com.au
Mon Apr 16 06:04:00 GMT 2001


----- Original Message -----
From: "Christopher Faylor" <cgf@redhat.com>
>
> > Robert Collins wrote:
> >Also while MSDN states that only one thread at a time can call the
> >entry point function, it does not state or imply that other threads are
> >suspended during that process.
>
> Ok, I reluctantly stand corrected.  I thought that both the MSDN and
> my own personal experience (waiting for a signal from Cygwi's signal
> thread that never arrived) said this.  I couldn't find any reference
> to this, though.

Moved thread  location.....

The system serializes calls to the dll entry point function and "it
suspends" the other related threads during the process.
(Jeffery Richer - Microsoft Press)

The attached patch can avoid the bottleneck but it may introduce new/old
problems.

Part of the patch is a reversal of a previous patch
http://sources.redhat.com/ml/cygwin-cvs/2000-q2/msg00041.html
What was the purpose of this patch?

Calling DisableThreadLibraryCalls could provide a cheap performance boost by
telling the system to not send DLL_THREAD_ATTACH and DLL_THREAD_DETACH
notifications to dll_entry when creating and destroying threads.

Any thoughts / has it been tried before / a bad idea ?

Regards Trevor




-------------- next part --------------
Sun Apr 16 16:30:00 2001  Trevor Forbes <t4bs@hotmail.com>

	* init.cc (dll_entry): Relocate initialization of mt_interface
	reent stuff. Call DisableThreadLibraryCalls.
	* debug.cc (thread_stub): Move mt_interface stuff here.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dll-init.patch
Type: text/x-diff
Size: 2258 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20010416/3181540b/attachment.bin>


More information about the Cygwin-developers mailing list