Originally posted by: PhatoseAlpha
The OS kernel handles scheduling decisions. The details are dependent on the kernel implementation.
Originally posted by: Smartazz
Originally posted by: PhatoseAlpha
The OS kernel handles scheduling decisions. The details are dependent on the kernel implementation.
Different operating systems have more efficient kernel systems right? So would that mean that Vista might be better than XP at multitasking if it were more efficient in that respect?
Don't know what else to say, if all tasks are equal in priority, windows xp will favor the window that has focus.
Originally posted by: bobsmith1492
As of Win2000/XP it was changed over so that the OS has full preemptive context switching. Before, the programs had to yield processor control to the kernel periodically; that meant if one thread locked up, it could grab control, go into a loop, and lock the processor for good.
Not a chance. Write a program that counts to, say, 2 billion 10 times and time it. You'll find that you get very very close to the theoretical speed of your CPU. IIRC, context switches take a handful of microseconds, while timeslices are multiple milliseconds.From what I hear overhead for switching was something like 10-20% of CPU time for Windows XP. I don't know where those numbers come from, but that's what I heard.
Originally posted by: CTho9305
Originally posted by: bobsmith1492
As of Win2000/XP it was changed over so that the OS has full preemptive context switching. Before, the programs had to yield processor control to the kernel periodically; that meant if one thread locked up, it could grab control, go into a loop, and lock the processor for good.
I'm pretty sure that's not true. Windows 95 and newer used preemptive multitasking; the only "major" OS in the same time-frame that used cooperative multitasking was Mac OS (the first version of Mac OS that used preemptive multitasking was OS X).
Not a chance. Write a program that counts to, say, 2 billion 10 times and time it. You'll find that you get very very close to the theoretical speed of your CPU. IIRC, context switches take a handful of microseconds, while timeslices are multiple milliseconds.From what I hear overhead for switching was something like 10-20% of CPU time for Windows XP. I don't know where those numbers come from, but that's what I heard.
I would still consider it preemptive. Set two processes to realtime, and observe them both running.Win95 and up have preemptive multitasking -- but not if you set your applications/threads to realtime priority and they then lock up.
Originally posted by: CTho9305
You can try http://ctho.ath.cx/tmp/counter/Debug/counter.exe if you want. I don't know if it would produce the right answer on Intel CPUs (I think it should). In theory, it should take 20 billion cycles (so, 10 seconds on a 2GHz chip). I get 1.6 GHz when running it normally, and 1.7GHz when setting the priority to real time (my browser, acrobat, winamp, and a couple other things use a few percent of the CPU time in the "normal" priority run). This puts the overhead at ~2% given the 1724MHz reported by WCPUID (and who knows what other stuff is happening besides the scheduler, e.g. hardware interrupts).
If you don't trust my binaries, you can build and run http://ctho.ath.cx/tmp/counter/counter.cpp.
I would still consider it preemptive. Set two processes to realtime, and observe them both running.Win95 and up have preemptive multitasking -- but not if you set your applications/threads to realtime priority and they then lock up.
Originally posted by: CTho9305
I would still consider it preemptive. Set two processes to realtime, and observe them both running.Win95 and up have preemptive multitasking -- but not if you set your applications/threads to realtime priority and they then lock up.
Originally posted by: CTho9305
I asked stash about this. I'd be interested in hearing whether it interrupts realtime processes or not.
Originally posted by: Smartazz
Originally posted by: PhatoseAlpha
The OS kernel handles scheduling decisions. The details are dependent on the kernel implementation.
Different operating systems have more efficient kernel systems right? So would that mean that Vista might be better than XP at multitasking if it were more efficient in that respect?
Originally posted by: Smartazz
If you go into Windows Task Manager and show kernel times, is that how much of the CPU scheduling is being used strictly for allocating the time slices?
Yeah, if I'm reading my copy of Windows Internals correctly, that is correct.Originally posted by: bsobel
Originally posted by: CTho9305
I asked stash about this. I'd be interested in hearing whether it interrupts realtime processes or not.
Absolutely, and being the highest priority thread, it will immediately get rescheduled and execute again.
Originally posted by: bsobel
Originally posted by: Smartazz
If you go into Windows Task Manager and show kernel times, is that how much of the CPU scheduling is being used strictly for allocating the time slices?
No, that includes all times spent in kernel (device drivers, io, etc)
I'm curious about that. I thought the caches were saved to memory and switched out every time the processor manager switched threads. Are you sure it doesn't?