Monster:
I only complain because, as a user I expect more. If Windows suddenly got better or I started using linux or (insert favorite non Windows OS here) and found that better, then you’d hear fewer complaints from me. However, I do think that some of Windows limitations are due to (1) legacy architecture and (2) unpredictable hardware configurations. As we’ve already noted, some Windows users like to build their own boxes and it’s very difficult for Microsoft to make their OS bulletproof without more rigid hardware configuration standards. It’s back to the old argument that the MacOS works better with a Mac because Apple produces both, where Microsoft has to cater to a wide variety of hardware manufacturers. There is certainly some truth to this argument…
Mr2001:
I think you’re operating under a very narrow minded definition of interrupt service routines, especially those running under modern, multitasking OSes. Also, as I pointed out earlier, your statement is equally valid if I susbstitute the word “application” for “interrupt handler” and recognize that it is, in fact, an interrupt that ‘triggers’ the context switch by the scheduler.
Not necessarily. In a well designed preemptive OS many of the activities that you may historically be associating with one shot interrupt service calls are managed as background tasks in more modern OSes. They don’t quit until they are done, however they may, themselves be interrupted by other priority interrupts or sometimes the task scheduler.
I really think the distinction you’re trying to draw is no longer valid.
Cool! I knew there was something about you that I liked…
I just wanted to note that, with the exception of some really, really bad software that I saw for the Mac back in the very earliest days of the Mac and a joke application that I once wrote, I’ve never seen an application that dominated the MacOS. I’m sure it’s possible and I’m sure that such attrocities do exist out there, but I think they are very, very, very rare. So rare that it makes no sense to worry about them. So one might ask, “Why does any one care about preemptive multitasking for MacOS X, then?” The answer is that, in some cases, preemptive multitasking can lead to better CPU utilization. The most often cited case is when an application is trying to read data from a disk and has to wait because the hardware is relatively slow. A smart task scheduler can preempt the application and let another process use the CPU during this wait time. If control is returned to the primary application before or as soon as the disk has provided the data, the application will suffer no degradation in performance. Another reason that preemptive multitasking is good for OS X is that processes can be assigned priorities (and these priorities can be changed dynamically). This allows a user to decide which process or processes get the lionshare of the CPU resources.
The Windows’ implementation of preemptive multitasking benefits from neither of these, BTW. More on this later.
The task scheduler does interrupt the application at unpredictable times. Perhaps I’m missing your point, but reentrancy is a requirement for any multitasking scheme. They only differ in their implementations of reentrancy.
Agreed, but that is because the reentrancy at this level is handled automagically by the compiler. Sometimes, especially when dealing with GUIs, managing the reentrancy at the compiler level isn’t adequate.
Well, it’s a problem with Windows’ implementation of preemptive multitasking. Again, I’ll try to address this in a minute.
Personally, I believe that many of Netscapes flaws have less to do with ‘bad’ programming and more to do with anticompetitive practices at Microsoft. Netscape is much more robust and polished in the MacOS and unix domains, even though there are more resources applied to the Windows domain.
It’s only acceptable if it doesn’t impact the user in any way. My point has never been that preemptive multitasking is a bad thing - only that Microsoft’s implementation of it is very weak.
Where to start??? I could probably go on incessantly on this, but I’ll spare you and just highlight a few points.
First, let’s start out by being clear on what Microsoft’s implementation of preemptive multitasking is. Fundamentally, Microsoft’s preemptive multitasking is a simple timeslice scheme. This means that an application’s operation is partitioned into discrete sequential executions. All tasks get an equal slice. In the unix world, all timeslices are not created equal. Each task has a priority and that priority can change dynamically, depending on environmental factors, ‘ambient’ user behavior, and upon specific request to change a process priority (possibly some other factors, but those are just off the top of my head). The task scheduler knows what’s going on in the application, to a certain extent, and can preempt a task if it’s waiting on slow hardware and lower it’s priority. Conversely, the scheduler is ‘aware’ of GUI operations and can assign these very high priorities so that they are less likely to get preempted causing user interface grief. I know this is why X is so responsive, I can only assume that BeOS fare better for the same reason. That, coupled with attention to detail in the reentrancy of their GUI code.
BTW, I’m not saying that Windows doesn’t prioritize tasks and threads. It certainly does. Just not as effectively as unix and there’s virtually no user control. Why would you want this? imagine the following scenario. You’re sitting in your office downloading mp3s in the background. You boss walks in and wants you to quickly rerun your financial report numbers. You know that this is a process intensive activity and you really want your boss to leave as quickly as possible. Wouldn’t it be ‘nice’ to supress or suspend your download process and get the financial report done more quickly? After your boss leaves, it would be ‘nice’ to bump your download process back up to make up for lost time…
(Note: the unix command to voluntarily change a process priority is called ‘nice’ - sorry for the cute wordplay)
I won’t continue to bore you, but there are other problems in Windows’ preemptive multitasking that have to do with very low priority activities being given arbitrarily high CPU access when non critical faults occur and poor handling of the semaphore mechanism for “critical sections” of code.
And that’s just talking about the scheduler, there are problems with Windows’ protected memory implementation and more… But I’ll shut up now… in deference to sdimbert…
BTW, in reference to my earlier claim that I had seen a prototype of a preemptive MacOS, here’s a relevant link:
http://bondiboard.macpublishing.net/1995/07/features/1044.html
I’m pretty sure that what I saw was an alpha prototype of this and the timing is about right.