Multiprocessing and Multitasking

cas

Learning Storage Performance
Joined
May 14, 2002
Messages
111
Location
Pittsburgh, PA
I hope you will excuse the new thread, but smp and threading issues have little to do with the way I look. ( Ok, maybe a little. Think geek. )

NT thread scheduling in a uniprocessor system is actually pretty simple. The highest priority thread, which is ready to run, gets the processor. If multiple threads of the same priority are ready to run, the processor is shared among them in a round robin fashion. Each thread will run for a period of time, called a quantum. Once the quantum has expired, the next same priority thread is scheduled to run.

In an attempt to increase throughput, improve the responsiveness of interactive programs, and ameliorate the effects of poorly coded programs, NT will occasionally boost the priority of a thread.

Thread scheduling in a multiprocessor system is a bit more complicated, due largely to attempts to limit FSB and memory bus contention. Generally speaking, the highest priority n threads, will run on an n-way machine. Lower priority threads may run in some cases due to processor affinity masks, which limit a thread to specific cpus. Even in the absence of application defined masks, the OS will attempt to schedule a thread on its ideal processor, or at least the last one on which it ran, because there is a good chance its working set in still in the processor’s cache.

If I were describing a traditional Unix implementation, I would at this point start to list the many cases where the above isn’t true. Because Unix was originally designed for uniprocessor systems, and traditional implementations are not reentrant, all kinds of caveats apply.

Of course, even in a properly designed operating system, a certain amount of cooperation among applications is required. Thread priorities are a bit like the TOS field in the Internet Protocol. If every application requests the best service, the field might as well not exist. In my opinion, user interface threads should never block on any call that does not also pump messages, and should only rarely exhaust their quantums. All cpu intensive threads should be completely decoupled from the user interface, and should run below normal priority. NT’s dynamic boosting is an attempt to encourage this configuration, but you can’t force application designers to write their software this way. If you did, you would greatly limit the flexibility of the system. There will always be that user who wants to seize the entire system (incl mouse pointer) while performing high speed data acquisition.

It is also worth mentioning that while the NT kernel was designed from the ground up to support threading and scalable smp operation, not all of the employees at Microsoft got the message. If you have ever waved one window over another, to reveal an unpainted mess, you know what I am talking about. However, this doesn’t mean that *I* have to write applications like that.

Now for a brief comment on that other OS designed from the ground up to support SMP operation. While Be never had any of the reentrancy and kernel locking problems of Unix, it is certainly no more SMP capable than NT. How hard is it to support multiple threads in win32/NT? Instead of calling MyFunc(), you call CreateThread( …, MyFunc(), …).

Of course, the real reason for BeOS’ posthumous popularity is that it was quashed by the same evil conspiracy that made Steve Guttenberg a star, and holds back the electric car.

But that’s a story for another time.
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,269
Location
I am omnipresent
Who controls the British crown?
Who keeps the metric system down?
We do! We do!
Who keeps Atlantis off the maps?
Who keeps the Martians under wraps?
We do! We do!
Who holds back the electric car?
Who makes Steve Guttenberg a star?
We do! We do!
Who robs the cave fish of their sight?
Who rigs every Oscar night?
We do! We do!

... everyone needs to break into song once in awhile.
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
cas said:
Of course, the real reason for BeOS’ posthumous popularity is that it was quashed by the same evil conspiracy that made Steve Guttenberg a star, and holds back the electric car.

Who controls the British crown
Who keeps the metric system down
We do!
We do!

Who leaves Atlantis off the maps
Who keeps the Martians under wraps
We do!
We do!

Who holds back the electric car
Who makes Steve Guttenberg a star
We do!
We do!

Who robs the cave fish of their sight
Who rigs every Oscar night
We do!
We do!

Sorry for being Off topic, but I wanted to post the whole version of that song. It's from the Simpsons and it is the Stonecutters drinking song.

Cas, you seem to like NT more than any other OS. In your opinion is there any other OS that is superior in design?
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
It's just tough for me to keep my trap shut when I see a Simpsons reference. I have all 13 seasons in VCD format, so I have seen every episode at least 5 times.

Please continue with the serious discussion now.
 

cas

Learning Storage Performance
Joined
May 14, 2002
Messages
111
Location
Pittsburgh, PA
By the nature of your question, you seem to realize that what I admire as an operating system designer is not the same as what an IT manager or even a user would find admirable. I recognize that middleware, available applications, price and so forth must be considered when comparing two real systems for a given application.

I admire NT, because it is a modern system with a rich set of features, and little in the way of gee whiz academic overhead. NT offers portability, a layered asynchronous I/O model, seamless multithreading, fully integrated exceptions, a uniform security model, and Unicode throughout.

While I truly respect such trailblazing Unix implementations as Solaris, and more recently Linux, they tend to be a hodge-podge of disjointed features

Although I am keeping my eye on Mach/OSX, NT in my opinion represents the best general purpose kernel design in wide release.
 

e_dawg

Storage Freak
Joined
Jul 19, 2002
Messages
1,903
Location
Toronto-ish, Canada
Cas, I have been waiting to hear your input on my problem with one application tying up my CPU and making multitasking an unpleasant experience in the "What do we all look like" thread, as you would probably know best what is causing this and how to fix it.

One debate involves the notion of dual CPUs being able to rectify the problem (or not); another debate involves the notion that the OS itself is to be implicated (either by not handling multitasking properly or not making use of dual CPUs effectively).

What are your thoughts on the matter?
 

cas

Learning Storage Performance
Joined
May 14, 2002
Messages
111
Location
Pittsburgh, PA
The only reason I have not commented on your specific problem, is because I can't reproduce it. I don't own Acrobat, and my machine never freezes for 5-20 seconds as you describe.

I do of course, make regular use of the Acrobat reader. It is the single buggiest application I use with frequency. Too many Mac developers at Adobe I guess.
 

e_dawg

Storage Freak
Joined
Jul 19, 2002
Messages
1,903
Location
Toronto-ish, Canada
I exaggerate a bit, as anything above 5 seconds is likely to be in those rare cases where I am saving 5 MB Acrobat files, for example (when was the last time you have even seen a 5 MB Acrobat file?) or when I have 2 dozen browser windows open at the same time, and JavaScript takes over 10 seconds to open a pop-up window. Most people I know never work with more than a few browser windows open nor do they keep them open for days at a time.

Another interesting example of this problem is with Outlook. When receiving mail (which is scanned by NAV), things are slightly frozen for a few seconds. Enough people should have Outlook (and perhaps NAV) that they should be able to reproduce this problem.
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,269
Location
I am omnipresent
cas said:
I do of course, make regular use of the Acrobat reader. It is the single buggiest application I use with frequency. Too many Mac developers at Adobe I guess.

So, you don't have RealPlayer or Quicktime4 installed, then?

I actually make PDF documents (with lots of embedded graphics) that exceed 20MB pretty regularly, and yes, it can "freeze" a machine for several seconds at times.
 

Tea

Storage? I am Storage!
Joined
Jan 15, 2002
Messages
3,749
Location
27a No Fixed Address, Oz.
Website
www.redhill.net.au
On Acrobat I have to agree with Cas. It is one of the very few applications that can screw up OS/2's multitasking to the point where the vital system processes (comms links and such) continue but the system becomes unusable until Acrobat has finished doing whatever it is doing. (Printing is the worst.) It's pretty bad on Windows too. And I hate the way they can't get such a simple, needful thing as on-screen scrolling right, even in the latest versions. On the other hand, it is at least truly cross-platform.
 

time

Storage? I am Storage!
Joined
Jan 18, 2002
Messages
4,932
Location
Brisbane, Oz
Anyone remember Envoy? File sizes were a fraction of Acrobat's, and back then at least, document navigation was way better. It even had an embedded reader, so that you didn't need to install Adobe's poxy software to open a document.

E_dawg, two facts leaps out at me from your problem description:

NAV and Outlook.

If you want to look for a culprit that can insert unwanted pauses into your I/O, NAV is a potential villain.

As for Outlook, are you running Express version 6? Under some circumstances at least, it appears to suck up all resources when sending email. Could you be describing an MS bug/feature?
 

timwhit

Hairy Aussie
Joined
Jan 23, 2002
Messages
5,278
Location
Chicago, IL
It seems that any system with a Norton or Mcaffee product on it is much slower than without. Why do you need antivirus software anyways. I haven't gotten a virus in about 5 years. If you just don't open e-mail attachments that are viruses then you won't get a virus.
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,269
Location
I am omnipresent
You have to get rid of the scripting host .EXEs and disable ActiveX and Javascript, too. THEN you're in good shape.
And pour salt over the sectors on your hard disk where Outlook-ish software was installed.

I have no problem with AV software on a business workstation. But it's disgusting that every single home user now needs a firewall, an ad-blocker and AV software just to use the PC they already paid for.
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,269
Location
I am omnipresent
Have you looked into so more the more modern quasi-*nix systems, cas? Hurd? AtheOS?

In a way it's kind of a shame that ideas from Unix keep getting used over and over again as the basis for operating systems. On the other hand, those ideas - and the tools that implement them - work pretty damn well.

It's pretty sad that ten-year-old NT really the most "modern" operating system I can think of.
 

e_dawg

Storage Freak
Joined
Jul 19, 2002
Messages
1,903
Location
Toronto-ish, Canada
Buck said:
e-dawg,

What type of video controller do you have?

Video controller? ATi All in Wonder 128. It may be a little slow :) in 3D games and unable to do video capture, but it's usually rock solid stable and fast in 2D apps and general Windows usage.

time,

I am running "just" Outlook (2000), no Express. I seem to remember it being pretty slow and resource intensive before I installed NAV as well. I don't think NAV made much of a difference except for extending the amount of time my computer is unresponsive because it has to scan the attachments. But the underlying problem, I think, was always there before NAV.

timwhit,

I used to think that way about antivirals before until I somehow got a virus. I was unwittingly propagating said virus to others who complained about to me about transmitting it to them. Needless to say, infecting other peoples' computers is unprofessional. I am usually careful as I never open attachments that are suspicious, but it may have gotten in through a floppy disk somehow. Anyways, I have always disabled NAV "auto protection" on my system. NAV is ONLY active for e-mail scanning and when I manually scan floppy disks.
 

e_dawg

Storage Freak
Joined
Jul 19, 2002
Messages
1,903
Location
Toronto-ish, Canada
Mercutio,

Interesting that you should create such large Acrobat files. Don't you ever have to distribute them to others? Most people I know are pissed when I e-mail them anything larger than 1 MB as they usually have problems either receiving or downloading them. I usually keep Acrobat files for myself under 3 MB or so to preserve both organization of the content (bookmarks and such) and the usability/responsiveness.

Acrobat would probably be frozen for over 2-3 minutes on my system if I were to save a 20 MB PDF file. In fact, one time I had killed the Acrobat process numerous times in a row when I was saving a large file because I thought it was not responding (well, the Task Manager said it was Not Responding). I decided to let it sit for a while next time and it turns out I just had to wait a couple minutes for it to finish.

As for using *NIX instead, I've tried several distros of Linux in the past to no avail. They were far worse than Windows in terms of speed and stability. Horrible crashing and molasses-like speed. Admittedly, most of the problems were in X and part of it was my incompetence with things Linux, but I have not to this day experienced the vaunted stability and performance of Linux despite 4 attempts on 2 different computers that I specifically built from components on RedHat's HCL.

I will, however, try it again in a month or two once I figure out how I am going to upgrade my box (single or dual CPU). This time with Gentoo Linux. I will be sure to pester every single one of you Linux devotees for help this time to make sure I am not the problem :)
 

Mercutio

Fatwah on Western Digital
Joined
Jan 17, 2002
Messages
22,269
Location
I am omnipresent
What I'm working on are many, many pages of notes with screenshots and digital photos and notes for my classes. The largest one I have - for my Network+ class - is 24MB, which takes a long minute or so to open on my big Windows box (XP1700+), and about a minute to save, but only small parts of that time are totally unresponsive.

And yes, I *do* remember Envoy.

I've heard of people getting Linux to crash. I've seen an actual Linux crash one time since 1994. I've trashed the console, had X crap out innumerable times, but somehow there's always a way to get things back to some sort of order. Speed can go either way... it's all a matter of expectation. I find programs take a hair longer to start but tend to be more responsive. None of the "I can type faster than the display can print" crap, like I get on NT (er, more from server versions, for obvious reasons, but if Linux can do it...)
 

e_dawg

Storage Freak
Joined
Jul 19, 2002
Messages
1,903
Location
Toronto-ish, Canada
I haven't had enough browser windows open for long enough yet, so my JavaScript pop-ups aren't taking 10 seconds yet, but I still notice quite a bit of CPU usage for such "simple" code. Here is an example of IE using 94% CPU usage when rapidly navigating through the jscript menus:

http://www.catalytic.ca/sr/js_1.gif

Even slowly browsing through the menu can create >50% CPU usage.

Open up the UD website and try it for yourself.
 

cas

Learning Storage Performance
Joined
May 14, 2002
Messages
111
Location
Pittsburgh, PA
Mercutio said:
So, you don't have RealPlayer or Quicktime4 installed, then?
Nope.
Is is just me, or are cross-platform apps the worst offenders?

Mercutio said:
Have you looked into so more the more modern quasi-*nix systems, cas? Hurd? AtheOS?
"The Hurd has always been on the cutting edge of not being good for anything." -Hurd kernel hacker

"In short: just say NO TO DRUGS, and maybe you won't end up like the Hurd people." -Linus Torvalds

Neither the Hurd, nor AtheOS are complete systems. When they reach 1.0, perhaps there will be something to discuss. Since it took 20 years for the Hurd to reach 0.2, at least we are on track for a century long development cycle.

Apple's Mach/OSX is certainly the most complete modern quasi-*nix system.
 

cas

Learning Storage Performance
Joined
May 14, 2002
Messages
111
Location
Pittsburgh, PA
Mercutio said:
It's pretty sad that ten-year-old NT really the most "modern" operating system I can think of.
It's not that sad. Completely new, general purpose operating systems are pretty rare.
 

time

Storage? I am Storage!
Joined
Jan 18, 2002
Messages
4,932
Location
Brisbane, Oz
e_dawg said:
Here is an example of IE using 94% CPU usage when rapidly navigating through the jscript menus:

http://www.catalytic.ca/sr/js_1.gif

Even slowly browsing through the menu can create >50% CPU usage.

Open up the UD website and try it for yourself.
I tried with Opera on an Athlon 1000. Moving side to size fairly rapidly I couldn't get above 15%, but I managed to hit about 25% by moving up and down "member services" as fast as I could (two or three complete passes up and down a second).

The same operation on a P450 got me above 60%.

Whoa! Just tried the same thing with Mozilla 1.0, and it was several times slower. Hit 100% on the P450 just moving left and right.

Tried to do it faster with Opera on the P450 and sometimes reached 70%. This is at least three passes a second.

Tried IE 5 on the Athlon. Holy smoke! It's even slower than Mozilla. With a faster machine than E-dawg, gentle movement didn't get me to 50%, but I was able to hit 96% going up and down flat out on the "member services" menu, although it wasn't actually drawing everything like Opera.

I think I'm beginning to understand why Opera hasn't added more javascript support (i.e. IE compatibility). It would probably slow down their engine dramatically.
 

e_dawg

Storage Freak
Joined
Jul 19, 2002
Messages
1,903
Location
Toronto-ish, Canada
While I can somewhat understand this jscript menu browsing CPU usage, I do not understand why opening a pop-up window can generate 100% CPU usage and freeze IE for up to 10 seconds with 2 dozen browser windows open for an extended period of time. It even pegs the CPU at 100% and freezes IE for a few seconds with a half dozen browsers as well. But the thing is that it is a one line jscript command to open a window. You are not doing a dozen rollovers a second like you are with the menus. One simple command. How can it possibly generate 100% CPU usage?
 

Cliptin

Wannabe Storage Freak
Joined
Jan 22, 2002
Messages
1,206
Location
St. Elmo, TN
Website
www.whstrain.us
e_dawg, I see what you are refering to now. On my machine I might have Outlook and one or two windows exploring windows open plus seven to ten IE windows open. It might become slightly unresponsive for a second at a time. 1800+, 256MB, GF2 mx400. Now we need a dual machine to approximate time's test.
 

Cliptin

Wannabe Storage Freak
Joined
Jan 22, 2002
Messages
1,206
Location
St. Elmo, TN
Website
www.whstrain.us
Cliptin said:
e_dawg, I see what you are refering to now. On my machine I might have Outlook and one or two windows exploring windows open plus seven to ten IE windows open. It might become slightly unresponsive for a second at a time. 1800+, 256MB, GF2 mx400. Now we need a dual machine to approximate time's test.
I also have NAV running.
 

P5-133XL

Xmas '97
Joined
Jan 15, 2002
Messages
3,173
Location
Salem, Or
I did time's test with a dual MP 1900+ using IE6. One processor peaked at 87% (that was the highest I could make it go, regardless of how fast the mouse was traveling through the menu's). The other processor was continiously ar 15%-20%. At no point could I make the machine freeze.
 

mubs

Storage? I am Storage!
Joined
Nov 22, 2002
Messages
4,908
Location
Somewhere in time.
e_dawg,

At the considerable risk of stating the obvious, if you're using IDE disks, I hope they're not running in PIO mode?

I went from a single proc to a duallie and my multi-tasking is way smoother now. I don't run any SMP-aware programs, but the reasoning I used was the one already mentioned; if one CPU gets "locked" up by an app, I have the other to work with. And I'm happy.

If you hit the sweet-spot in the technology/pricing curve, it won't hurt the pocketbook so much!
 

e_dawg

Storage Freak
Joined
Jul 19, 2002
Messages
1,903
Location
Toronto-ish, Canada
mubs,

I am using an Atlas 10k (U2W SCSI) as my main drive. Nevertheless, I always set IDE drives to their highest ATA mode, even though W2k displays PIO mode with its ATA mode reporting bug.

Anyways, I wish Intel would have made HyperThreading available to the masses last summer instead of slowly introducing to desktop CPU's in the near future. No way I was going to spend $400 US on a dual Xeon motherboard plus $500 US on 2 Xeons.
 

mubs

Storage? I am Storage!
Joined
Nov 22, 2002
Messages
4,908
Location
Somewhere in time.
e_dawg,

I'm not familiar with the w2k ATA mode reporting bug?? I see whatever's approriate for my devices.

I coudn't afford Xeons--no way. I built my system about 2 years ago with a Tyan Tiger 100 (S1832DL) BX Chipset + 2 P3-850 CPUs, 1GB PC-100. The MB was $160 and each proc was about $200. I'm all IDE - can't afford SCSI (yet...), but peorf with decent 7200 RPM IDE's is acceptable to me.
 

blakerwry

Storage? I am Storage!
Joined
Oct 12, 2002
Messages
4,203
Location
Kansas City, USA
Website
justblake.com
even though W2k displays PIO mode with its ATA mode reporting bug.

What bug???

AS far as I can tell... when win2k/XP says PIO.. and I run a benchmark... it really is PIO mode (Even if during bootop it said something else)... HIgh CPU usage and slow transfer rates are the pits.
 

P5-133XL

Xmas '97
Joined
Jan 15, 2002
Messages
3,173
Location
Salem, Or
There was a W2k reporting bug related to Ultra-66/100. Controllers that used those ATA modes (Before SP1) reported PIO mode but ran in ultra-33 mode. That bug was fixed in SP1 and was never a problem in XP
 
Top