[ck] Re: Threading issues? [ck-request@vds.kolivas.org: ck Digest, Vol 3, Issue 16]

Michael Chang michael at cherryblossom.homelinux.com
Sat Aug 28 21:13:04 CDT 2004

On Sat, Aug 28, 2004 at 01:54:19AM +1000, Con Kolivas wrote:
> Mike Hearn wrote:
> >>>Well, apparently we don't use sched_yield, so the problem must
> >>>>lie somewhere else. Maybe Con can help us out here? Alexandre says he
> >>
> >>Interesting. Probably the most valuable information is that it seems 
> >>to work fine if we artificially limit the threads to exactly the same 
> >>timeslice _or_ we put them at such a low priority that they are forced 
> >>to be guaranteed to round robin one task at a time. This is the way 
> >>2.4 used to work which is why with the new 2.6 schedulers which do far 
> >>more out-of-order rescheduling some applications have a problem; 
> >>particularly under load. I suspect it's actually the latter issue. 
> >>Locking between threads should prevent that being a problem, though. 
> >>You already mentioned that you dont use sched_yield() and I couldn't 
> >>even begin to look at the wine code myself so perhaps you know 
> >>something more.
> >
> >
> >Hi Con,
> >
> >One thought that occurred to me, and this is just a random theory, is 
> >that maybe the issue is not with the Wine code but the Win32 code run on 
> >top of it. Do you know how 2.6 scheduling compares with 2.4 and Windows 
> >(NT) scheduling? Could it be that some apps are written to expect 
> >Windows-style scheduling and fail to work if they don't get it?
> I argued with myself about the logic in this for ages. The best I could 
> come up with is - I don't know :| I'd need to know about windows 
> scheduling (which I don't)

Obviously, if Win apps have been written to expect this, there's
documentation somewhere... if someone has free time, maybe look for it?

IIRC, there are some things about priority scheduling, and that apps
take complete control of the CPU for a set period of time based on that
priority (something like Very High, High, Normal, Low, Very Low or
something in the eyes of a consumer) -- which leads to the behaviour
that CPU intensive apps which have high priority slow down the PC and
take up loads of CPU time, and poorly written apps that have high
priority can loop forever, and crash/freeze the PC because other apps
don't get CPU time, nor does the interrupter (Ctrl-Alt-Del and it's Task
Manager (which IIRC worked better in 9x by taking over and halting all
processes but itself, but had more features and became an app like
everything else in later versions)).  Unfortunately, this is all
speculation, because I am a 9x user with some experience with XP
machines, not a Windows Developer.

> and how wine treats that scheduling (which I also don't).

Can someone explain where this is written, or why it isn't?

> Cheers,
> Con

Just a curious onlooker,
--Michael Chang

More information about the wine-devel mailing list