• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How long until we see a true multitasking OS?

SunnyD

Belgian Waffler
The problem today, as I see it, we have OS's that are merely adequate to the task of mutlitasking. With AMD pushing 4x4 out the door, and Kentsfield, the question has been asked already - what benefit do multiple processors bring?

The current answer - nearly none, unless the application itself is designed to facilitate these things. I'm currently seeing the single threaded trend becoming problematic, especially when it comes to AMD and Intel (and others) selling multi-CPU systems to the average user. And the problem isn't the single threaded apps. The blame lies squarely on the shoulders of the OS.

Honestly, even on multicore machines, a single threaded app can bring the entire system to a grinding halt, simply because the OS cannot figure out how to adequately utilize multiple processors. In windows, for example, I can look at thread affinity for all of my currently running applications, and near all main threads of execution (which for the majority of applications is the ONLY thread) are running on core 0. An application can spinlock a system on one core, leaving the second core to flounder doing absolutely nothing. Why? Why isn't a multiprocessing OS aware enough to load balance at the very least? And with more cores on the way, what does this provide? Even less in terms of performance benefit.

When are we going to see an OS that will actually benefit the end user to have multiple cores? I can see it now - 4x4 using dual quads - Cores 1 through 7 with realtime thread priority allowing single- and multi-threaded apps to run nicely, and core 8 having the OS neatly tucked away to handle all of the mundane IO needs for the rest of the world.
 
XP sucks pretty badly with multithreading. Vista and Win2003 are supposed to be better, but I have no first-hand experience with it. The various *nixes seem to do pretty well with it though.
 
I don't have any of the problems your describing. My system utilizes my dual core system quite nicely... I can do things like ripping a DVD and play a video game at the same time with little to no performance impact on either proccess.

The vanilla Linux kernel has proven performance up to 32 or 64 CPUs in a NUMA architectures. It is able to detect and react to changes in the fabric even. So say your using a high end Itanium machine and active a extra node of 4 or so proccessors then the system is able to detect this and adapt to the new situation. Also it is capable fo understanding the memory layout of the system.. for instance you can have AMD64 machines with two dual core CPUs with each pair having it's own memory bank. Linux is able to detect this and use that in scedualing proccesses so that you don't loose performance from having to swap application data back and forth between memory banks.

For very high end machines you can get modified Linux kernel that work on SGI 512 proccessor machines efficiently. SGI even provides beowolf clusters of these machines to people like NASA and such.

(if you want I can show you benchmarks were Linux 2.6 series provided a 600% (literally) increase in web serving performance over Linux 2.4 on 8-way Xeon machines due to the improvements that IBM and SGI put into the kernel...)

So I guess we have a OS that efficiently handles multiproccessing and such. Maybe it's just that your not using it?

Probably your biggest problem is that your using XP which was designed for desktop systems were you have a single proccessor or relatively unsophisticated SMP machine. Especially XP home. Maybe you should use a server OS specificly designed for SMP operation? I bet Vista has improved quite a bit over XP.

Otherwise Debian or Ubuntu can get you want you want...
 
I was under the impression that the culprit is the application software,
as its not written to take advantage of multiple cores....hey what ??
 
Originally posted by: bendixG15
I was under the impression that the culprit is the application software,
as its not written to take advantage of multiple cores....hey what ??

Well his problem is that his system is not able to efficiently load balance multiple applications over multiple CPUs. So he would end up with one core that was pegged at a 100% utilization were the other core was sitting mostly idle.

Even though individual single-threaded applications have little benifit from having dual core cpus you should still see a marked improvement of peformance when running muptiple single-threaded applications.

For instance if your running Doom3 you should be able to do something like encode audio files at the same time with no performance impact (except that maps may load slower due to harddrive activity)
 
What you're looking for has been available to Linux and Solaris users for a while now. Maybe your OS of choice is lagging behind, but not everyone's is. 😉
 
Even NT 4 did a reasonably good job running multiple single threaded apps simultaneously. XP, yes even *cough* XP Home *cough* should be able to handle SMP (albeit only through a single socket).

I suspect the 'lag' you're referring to is not specifically CPU related, but when other shared resources are tied up (i.e. memory, I/O or interrupts).
 
Originally posted by: spyordie007
Even NT 4 did a reasonably good job running multiple single threaded apps simultaneously. XP, yes even *cough* XP Home *cough* should be able to handle SMP (albeit only through a single socket).

I suspect the 'lag' you're referring to is not specifically CPU related, but when other shared resources are tied up (i.e. memory, I/O or interrupts).

Harddrive activity would be a big peformance bottleneck..
 
Originally posted by: drag
Originally posted by: spyordie007
Even NT 4 did a reasonably good job running multiple single threaded apps simultaneously. XP, yes even *cough* XP Home *cough* should be able to handle SMP (albeit only through a single socket).

I suspect the 'lag' you're referring to is not specifically CPU related, but when other shared resources are tied up (i.e. memory, I/O or interrupts).

Harddrive activity would be a big peformance bottleneck..
Drives me crazy, you see all these people who go out and buy the latest greatest radio shack special and boast about how their machine is sooo fast with the new dual-core CPU and high-end video card but than the whole system is left to rely on some ass-slow hard drive.

I'd much rather have fast storage than a fast CPU. Oh wait, I do!
 
Originally posted by: spyordie007
Originally posted by: drag
Originally posted by: spyordie007
Even NT 4 did a reasonably good job running multiple single threaded apps simultaneously. XP, yes even *cough* XP Home *cough* should be able to handle SMP (albeit only through a single socket).

I suspect the 'lag' you're referring to is not specifically CPU related, but when other shared resources are tied up (i.e. memory, I/O or interrupts).

Harddrive activity would be a big peformance bottleneck..
Drives me crazy, you see all these people who go out and buy the latest greatest radio shack special and boast about how their machine is sooo fast with the new dual-core CPU and high-end video card but than the whole system is left to rely on some ass-slow hard drive.

I'd much rather have fast storage than a fast CPU. Oh wait, I do!

I agree, I rather have a fast storage system along with plenty of system ram.
 
While all your points are valid, I should point out a couple things. I am not specifically talking about my system - as my home machine is a single core Sempron. My work laptop is a Conroe, and I've seen the described behavior. But what I really want to stress, I have seen countless dual core systems exhibit this behavior. I completely understand what happens under the hood and in the OS, as that's my background. But the long and the short of it is todays consumer desktop OS just doesn't seem to be designed for where technology is going. Vista aside - though I'd venture to guess that it won't be much better than XP was.

Also, I'd like to point out a typical situation... a system is running application A, B, C and the OS. Application B decides it is going to hang... IO aside, the app is in the process of crashing or what have you. For whatever reason, the application hangs the system, and it resides on core 1. But there is no IO happening, and resources on core 2 should be free and able to continue on, but doesn't. For whatever reason, either the system can't trap and switch context, or maybe the OS can't recover enough from core 1 to become responsive, etc. This should NOT happen. But it does. Sure, you can blame a badly written app, but once you get to this level, with the resources available, the OS has to bear some responsibility.
 
Strange thing is, one of the first things I've noticed is that kind of thing doesn't happen on the dual core systems I work on (including my personal PC). For example, there's a particular program I use that occasionally locks up (a media player, when seeking videos rapidly and repeatedly). It locks resources up so badly that even task manager takes a few minutes to load up (on an A64). On the DC system, the system doesn't slow down.

Likely it's just something different from your case though. I'm wondering if this occurs with a wide variety of software and which?
 
Sure, you can blame a badly written app, but once you get to this level, with the resources available, the OS has to bear some responsibility.

Well that sounds like a kernel issue then.

now i know that NT was a 'preemptive' kernel from the get-go.. but also Linux pretty much always had eliments of 'preemtive-ness' also. But there are different levels of preemtive-ness and I don't think there is a kernel that is totally preemptive yet, but I could be wrong.

But what that sounds like is kernel locking issues. There is some critical portion of the kernel that is being acted on by whatever the borked application can do and the system just hangs until that problem gets resolved.
 
We weren't pointing our fingers at the apps; we were pointing our fingers at the hardware.

A laptop with a dual core is a great example, it has a slow hard drive and shared bus. Even if there is no hard drive I/O a single app using 100% of a single core could be saturating the bus to the memory and chocking out everything else.

This is a big part of the reason that this isnt as much of an issue on high-end servers.

Of course at this point the discussion is mostly academic...
 
Guys I'm just not getting this thread at all I guess.

What do you mean by "how long until we see a true multitasking OS?"

We've had preemptive multitasking for ages now.

If you've got something single threaded running you're stuck with it. Any attempt by an OS to somehow SMP such a task would be disasterous. Even in this scenario OSs today will still happily service interrupts and other threads on the other CPUs just fine.

The whole app locking up a dual core machine is hogwash. Something else is happening in such a case. An app locking up doesn't lock up any of the processors in the machine. The app will be context switched in and out as normal it just won't be doing anything during it's timeslices.

So I guess I'm just not getting this.



Drag: Yeah NT OSs are completely preemptive unless you are talking about a masked IRQL. For Applications this means 100% preemptive. It's always been this way. I wouldn't be the guy to ask but I was under the impression Linux has always been the same.
 
Smilin:

With multiple cores, especially when we start seeing 4, 8 and more processors, why are we even talking about preempting anything? Yes yes, I know that even 8 cores means people will be running more than OS + 7 apps... so there will always be a need for preemptive multitasking. But honestly, on desktops and laptops alike, I have watched the OS completely die to a single threaded app crash. I am not asking for the OS to make single threaded apps SMP capable. I'm asking for the OS to actually utilize multiple cores efficiently and in a manner that makes sense.

Case in point: WHY do we even have to bother with thread affinity in Windows with ANY application?

I agree that multiple processor systems are generally more responsive than single CPU systems. But honestly, other than something disastrous, no single-threaded app should be able to take down a multi-processor system.
 
Originally posted by: spyordie007
Originally posted by: drag
Originally posted by: spyordie007
Even NT 4 did a reasonably good job running multiple single threaded apps simultaneously. XP, yes even *cough* XP Home *cough* should be able to handle SMP (albeit only through a single socket).

I suspect the 'lag' you're referring to is not specifically CPU related, but when other shared resources are tied up (i.e. memory, I/O or interrupts).

Harddrive activity would be a big peformance bottleneck..
Drives me crazy, you see all these people who go out and buy the latest greatest radio shack special and boast about how their machine is sooo fast with the new dual-core CPU and high-end video card but than the whole system is left to rely on some ass-slow hard drive.

I'd much rather have fast storage than a fast CPU. Oh wait, I do!

I hear you, sold my old game machine with a 1st generation 74GB raptor. The new machine I built as the latest 16MB version 😀

As for multithreading. I dont know, it appears for the most part both of my cores are being used in windows and applications. The only game I have seen that doesnt do much with the 2nd core is FlightsimX, go figure, an MS product 😀

Otherwise I am very happy with the performance of my core 2 duo. I am not easily impressed even with the stuff I build. But this time around I have been blown away.

 
With multiple cores, especially when we start seeing 4, 8 and more processors, why are we even talking about preempting anything? Yes yes, I know that even 8 cores means people will be running more than OS + 7 apps... so there will always be a need for preemptive multitasking.

Because most apps are I/O bound so if yo udon't preempt them everything will run only as fast as the slowest I/O device in use. As soon as a process asks for data from the hard disk or network it's put to sleep while the device fetches the data so that other things can run. You could have only 1 process running and 7 cores idle and it'll still get preempted regularly unless it's just sitting in a while (1) {}; loop.

But honestly, on desktops and laptops alike, I have watched the OS completely die to a single threaded app crash. I am not asking for the OS to make single threaded apps SMP capable. I'm asking for the OS to actually utilize multiple cores efficiently and in a manner that makes sense.

Then something is wrong with your setup, even on my old dual Celeron 466 and dual Athlon 1.2 machines I've never seen them die with just 1 process using a lot of CPU.

Case in point: WHY do we even have to bother with thread affinity in Windows with ANY application?

Generally you shouldn't, all setting a process's affinity will do is restrict the scheduler's ability to allocate CPU time. There are corner cases where you want to keep 1 process on a specific CPU because cache misses and migration time cost too much, but that's extremely rare.

But honestly, other than something disastrous, no single-threaded app should be able to take down a multi-processor system.

And it can't, hell I don't think I've ever seen a single-threaded app take down a UP system of mine.
 
Originally posted by: SunnyD
Smilin:

With multiple cores, especially when we start seeing 4, 8 and more processors, why are we even talking about preempting anything? Yes yes, I know that even 8 cores means people will be running more than OS + 7 apps... so there will always be a need for preemptive multitasking. But honestly, on desktops and laptops alike, I have watched the OS completely die to a single threaded app crash. I am not asking for the OS to make single threaded apps SMP capable. I'm asking for the OS to actually utilize multiple cores efficiently and in a manner that makes sense.

Case in point: WHY do we even have to bother with thread affinity in Windows with ANY application?

I agree that multiple processor systems are generally more responsive than single CPU systems. But honestly, other than something disastrous, no single-threaded app should be able to take down a multi-processor system.

Preemptive multitasking happens on just a single core CPU too. There will always be preemption no matter how many cores you have. Just because you see a thread running on core 1 and a different thread on core 2 doesn't mean those threads aren't constantly being prempted by other threads running on those cores.

Running N applications where N = Number of cores+1 isn't what causes preemption. I'm on a dual core box right now and ~1000 threads are running (for about a dozen apps). If there were some sort of multitasking problem happening I'm pretty sure I would be aware of it 🙂

If you have watched a multi-core OS crash/lockup when running an app it likely has nothing at all to do with some problem with multitasking. More than likely the app that appeared to be hanging the whole system was a symptom, not the cause. There really should be no reason to set affinity on anything either. The only time that comes into play is for reasons that are far outside the scope of what you could possibly code into a scheduler.
 
these issues are mostly to do with the OS scheduler and load balancing. afaik most newer *nix kernels do a very good job with multiple processors/multiple cores (several people have already mentioned this in the thread). by contrast in this regard, windows is t3h suck.

also preemption is necessary because one process can sit in a while loop and never yield cpu time, processes like these need to be preempted by the OS. applications like this written in a multitasking environment are *supposed* to handle these things themselves (i.e. yielding) but if they don't, then the OS needs to make them yield.
 
Originally posted by: shader
newer *nix kernels do a very good job with multiple processors/multiple cores...by contrast in this regard, windows is t3h suck

In what way? Frankly that sounds like some, "From what I've heard" FUD.

... the OS needs to make them yield.

It does.






edit: mauled my nested quotes
 
I have personally experienced this many times: start something single-threaded and resource-intense (e.g. a FLAC encoder) on a dual core CPU running Windows XP. That one core will be pegged, and the system will come lagging (sometimes almost to a halt). Audio will skip with no end, despite being streamed from a different disk than the FLAC encoder is using. The Adobe DNG converter also causes horrible lagging in a similar manner, for example. I don't know what the problem is, and while I don't like jumping on the "blame Windows" bandwagon, I don't know what else is at fault - an application, no matter how much CPU it needs, should never be allowed under a modern operating system to bog everything down as often happened with Windows 3.1.

Edit: so concerning the previous post... the OS does not make some applications yield, though it should.
 
Edit: so concerning the previous post... the OS does not make some applications yield, though it should.

It does make them yield otherwise the whole system would appear locked up until it finished. Use taskmgr to knock the encoder down to "Below Normal" and see how responsive the UI is then.
 
Drag: Yeah NT OSs are completely preemptive unless you are talking about a masked IRQL. For Applications this means 100% preemptive. It's always been this way. I wouldn't be the guy to ask but I was under the impression Linux has always been the same.

Well I don't know to much about all of it, little bit over my head. When I read articles and people talking about 'preemtive' kernel the terminology isn't very solid and can mean different things. Maybe you can help me out a bit.

Obviously the Linux kernel has always been preemtive after a fasion. It's been good system for a long time for single or 2-way proccessing system for server loads. Originally it had a 'big kernel lock' type setup, but breaking that down was nessicary for SMP support. But otherwise 2.2 kernels and to a lesser extent 2.4 kernels had the situation were a kernel system call was not preemptable. In otherwords if a low-priority task was running and it was engaged in a system call and it's cpu time was expired it would still be in the way of higher priority tasks until it finished with the kernel.

But with the introduction of 2.6 kernel it allowed for application system calls to the kernel to be preempted.

However there are still little locks all over the place. People have been whittling them down over time and increasing the grainularity of them.

Nowadays people are working on getting the Linux hard realtime-capable with things like 'volentary preemption' from the realtime-preempt patch set (which is slowing being integrated into the kernel peice by peice). This eliminates spinlocks almost entirely and replaces them with mutex and other such things that I don't understand. As well as other improvments and changes to the kernel. All I know is that with those patches I can do things like set priorities on IRQ and do wonky things like giving a userspace daemon special realtime privilages that give it higher priority then what the disk controller gets.
 
Back
Top