Magnus Holmgren <magnushol <at> gmail.com> writes: > I did some testing on my 64-bit Vista system, and it appears that > CreateThread is the main cause.
I think I've found the reason for the slow CreateThread. It seems like the following remark in the MSDN documentation is relevant, at least for WOW64 processes: * During process startup and DLL initialization routines, new threads can be created, but they do not begin execution until DLL initialization is done for the process. To test this, I removed the call to sigproc_init in dll_crt0_0 and made sure it was always called in dll_crt0_1 instead. Suddenly the sigp thread started executing immediately, and its initialization was complete long before wait_for_sigthread was called. Even with this change, a "date loop" isn't blazingly fast on my computer (cygwin1.dll created from 1.7.7 sources, first number is executions per second): 26 Wed Sep 1 18:47:36 WEDT 2010 27 Wed Sep 1 18:47:37 WEDT 2010 26 Wed Sep 1 18:47:38 WEDT 2010 But it is a clear improvement (using the stock 1.7.6 dll): 9 Wed Sep 1 18:52:35 WEDT 2010 9 Wed Sep 1 18:52:36 WEDT 2010 9 Wed Sep 1 18:52:37 WEDT 2010 PS. There are a few trace printfs in cygthread::create that uses "name" in the argument list to print the thread name. That doesn't work nearly as well as "__name". :) Magnus -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple