(Mis)using threads (solution found)

Florian Schirmer jolt at tuxbox.org
Thu Mar 13 11:41:26 CST 2003


>Actually, Wine does not have a scheduler as such (well, it has a
>scheduler for 16-bit tasks, but not for 32-bit processes/threads).  
>Wine threads are just normal Linux tasks created with clone().  
>The usual Linux scheduling rules should apply ...

Thanks for pointing this out. While digging through the "scheduler" i
noticed that wine creates the threads in exactly the same way (using clone)
as i did in wines back. So i was wondering what actually is different. To
sched some light onto it, i replaced my clone() call with wines CreateThread
call. And guess what: it works very well without any trouble. 

I haven't looked deeper into what has caused this trouble, but i suspect
some sleeping/waiting trouble. The new thread proc (for both the clone and
the CreateThread thread) does nothing except registering an alsa async
callback handler and then sleeping (using linux native nanosleep) all the
time. The old thread handler (which works pretty well on win32) probably
calls in some sort if message handling loop. Using the native win32 Sleep()
call instead of linux native nanosleep will break things again. So wine is
unable to waste time in the proper way ;-)

Thanks _a lot_ to all who helped me with my issues.


More information about the wine-devel mailing list