CreateThread timing behaviour (Bug 15323 affecting Warhammer Online)

Paul TBBle Hampson Paul.Hampson at Pobox.com
Sun Mar 1 21:28:17 CST 2009


On Mon, Mar 02, 2009 at 12:29:14AM +0200, Pauli Nieminen wrote:
> Msdn sayes:
> "The ExitProcess, ExitThread, CreateThread, CreateRemoteThread
> functions, and a process that is starting (as the result of a call by
> CreateProcess) are serialized between each other within a process.
> Only one of these events can happen in an address space at a time.
> This means that the following restrictions hold:

>     * 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.
>     * Only one thread in a process can be in a DLL initialization or
> detach routine at a time.
>     * ExitProcess does not complete until there are no threads in
> their DLL initialization or detach routines."

> So maybe this hidden synchronization is causing also newly created
> thread not to run until CreateThread has exited.

How would I know if one of these was the case? 'cause if that's what's
going on, it'd explain the problem quite neatly.

I should mention that the actual code being run here is inside a dll
file (libpatchui.dll) not the main warpatch.bin.

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, B.Sc, LPI, MCSE
Very-later-year Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Pobox.com

Of course Pacman didn't influence us as kids. If it did,
we'd be running around in darkened rooms, popping pills and
listening to repetitive music.
 -- Kristian Wilson, Nintendo, Inc, 1989

License: http://creativecommons.org/licenses/by/2.5/au/
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20090302/6cde6cb5/attachment.pgp 


More information about the wine-devel mailing list