Mac Metamorphosis

Introduction to Unix: The Buzz Words

- 2001.02.20

I am sure people are getting tired of hearing about multithreading, symmetrical multiprocessing, memory management, and preemptive multitasking. How is it really going to affect you, the Macintosh user, under Mac OS X - when you just want to read Low End Mac, check your email, and write a document.

Multithreading

O.K., what's the deal on Multithreading. What is a thread anyway?

Threads are instructions that are executed within the operating system or the application you are running.

In Blame it on Mac OS, I yelled about how the Mac OS would lock up when loading an MP3 file on my somewhat slow server. That's because of a threading and the Mac OS being single threaded. I had two tasks going on at once. I was typing, and my MP3 file was loading. They are both sharing the same thread, and both trying to be executed down the same pipe. It's like two people trying drink from the same straw at the same time.

In a multithreaded environment, when my next MP3 was ready to be loaded, a separate thread would be spawned and would be its own independent entity.

What will really restrict you in a multithreaded environment is how much memory you have. More memory means each thread can have some more space to work and accomplish it's task quicker.

Symmetrical Multiprocessing

With the Mac OS, multiprocessing is done asymmetrically. All your tasks are done on one processor, and when that one has hit it's maximum capacity the operating system moves the task over to the other processor. When multiprocessing is done symmetrically all processors are acting as one, sharing the load.

When using a Symmetrical Multiprocessing operating system, applications don't know that there are two processors instead of one. So if you get a really power hungry application, it's going to go after everything it can, which means that it's going to be using both CPU's resources. With both processors working in conjunction with each other, you will notice a significant performance boost, because it will be getting the task done twice as quick.

Memory Management

This is one of the biggest reasons why system administrators use Unix. We all know what happens when one of your applications in Mac OS crashes: You have about a 50/50 chance of not having to reboot. What it comes down to is, "Did my crashed program manage to invade another one of programs personal space?"

On a Unix system, each application gets its own block of memory and is confined to the particular area of memory that it's assigned. If the application decides to crash, it doesn't bleed over into the rest of your system. I would really hate to have to tell my boss, "We have to reboot the system, because Jane's server based Word processor decided to crash."

Having memory management does require some more horsepower when it comes to multitasking, because the operating system has to seek out and allocate memory to an application on an as needed basis. This can be very bad when something called a memory leak occurs, where an application has not returned it's discarded memory and keeps asking for more. Your system will then slow down, because you don't have as much memory available because that one particular program is hogging it all because of a memory leak.

Preemptive Multitasking

Mac OS currently uses cooperative multitasking, which is when the current application you are working in has control over your CPU - and any applications you have sitting in the background take a back seat waiting for their turn to be allowed to do something. Most applications don't take all of your CPU resources, so your background applications are still able to function, but they are handicapped, because they are not getting the resources that they want.

An example of this is when I am downloading something in Internet Explorer on my Mac and switch to another application. The second I do that, my download speed drops quite significantly. That's because the active application has just taken control of my CPU, and it decides to throw Internet Explorer a bone or two when it's not doing anything too intense.

In a Unix Preemptive Multitasking environment, the operating system (or you) decides what gets to use what portion of your overall resources. If I am downloading from Internet Explorer and decide to launch my MP3 player, Internet Explorer still gets to keep all it's resources even though I am not actively in it.

Applications are also given priorities, so a system specific task would take priority over my word processor. If the system needs to display an alert, it would take priority over anything else that is happening.

One of the perks of priorities is that you can manually set priorities over anything you want. If I have 30 people trying to print to a printer on my Unix system, I can have my print jobs take priority over everyone else's. Even though they sent in their request 10 minutes before I even hit the print button, I can tell Unix that I take priority over all others.

Should you be sharing applications from your system, you can cap the users accessing the application to how much of your resources you want them to use. You can also cap them on a user or group level.

If Jim only uses a word processor on my system to open small documents, I will only allow him 2% of my resources. But if Mary opens very large documents, I will give her up to 5% of my resources.

Setting priorities and resources manually can get very complex, so I only recommend doing so if you are running a Unix system as a server and need to do load balancing. I will say that it can be a lot of fun, especially when it comes to you getting your print jobs out before everyone else.

About LEM Support Usage Privacy Contact

Custom Search

Follow Low End Mac on Twitter
Join Low End Mac on Facebook

Favorite Sites

MacSurfer
Cult of Mac
Shrine of Apple
MacInTouch
MyAppleMenu
InfoMac
The Mac Observer
Accelerate Your Mac
RetroMacCast
The Vintage Mac Museum
Deal Brothers
DealMac
Mac2Sell
Mac Driver Museum
JAG's House
System 6 Heaven
System 7 Today
the pickle's Low-End Mac FAQ

Affiliates

Amazon.com
The iTunes Store
PC Connection Express
Macgo Blu-ray Player
Parallels Desktop for Mac
eBay

Low End Mac's Amazon.com store

Advertise

Open Link