Multithreading Extensions for Mac OS 9? 18
P-Rod asks: "With Apple reportedly about to announce multiprocessor G4s, many have been asking why they'd do so before OS X is released, since OS 9 doesn't have the multithreading that OS X has. What about a multithreading extension? Apple has been really good at allowing newer products to work with older ones and vice versa. Apple's ultra-smooth transition to the PowerPC chip back in 1994 is a great example. So is the CarbonLib extension, which lets you run Carbonized OS X programs on OS 8.1 and up. Is a multithreading extension feasible?"
Re:MacOS multithreading/multiprocessing (Score:2)
For further details of the Apple Multiprocessing API, what calls can be made, what can't, and all the rest of the dirt, try this link (dates from 20 Mar this year, so it's not out of date).
Technote 1071 [apple.com]Is it any surprise that the new (2.1) version of Multiprocessing services was released just before the MP G4's were previewed? I think not.
Simon
MacOS 9 is AMP (Score:1)
However, classic MacOS uses extra processors differently, essentially (as I recall) letting software that knows about the extra processor(s) take advantage of them by offloading tasks. For algorithms which are not easily parallizable, or programmers that are lazy, this makes some amount of sense -- it allows you to essentially devote a single processor to a single process, and use the other CPU for inconsequentials like displaying the results of the calculations.
When the system was bought/built/ordered with a specific multiprocessor app in mind (like Photoshop), and a specific purpose, it can work OK. Of course, for end-to-end improvement and responsiveness, pre-emptive multitasking, threading, and SMP are all necessary.
Since I'm not too familiar with it, hopefully someone else will come along and correct/inform me
Re:Hidden stories (Score:1)
For
The OS doesn't need to support SMP to get a boost. (Score:2)
The MacOS can use multiple threads right now. Although it's all done through cooperative MT, it does (kind of) work. Through used hardware dealers you can still get MP CPU cards for older PCI macs.
The bottom line is still this, the MacOS doesn't explicitly support SMP but extra processors can still be used for increased processing power.
LK
Re:Do you need it? (Score:1)
This is because the 6116 is basically a Power Macintosh 6100 with a different software bundle, and the 6100 is a NuBus Mac, not a PCI Mac [yellowdoglinux.com].
Sorry to say it, but you are out of luck with YDL and most other distros.
-Smitty
Re:Do you need it? (Score:1)
MkLinux works fine, and I actuially prefer some of it's features to LinuxPPC. (Like the color-coded boot sequence thanks in part to Mach.)
I certainly wouldn't recommend those machines as a high-traffic web server or anything, but they do make good machines for light serving because of their relatively compact size. Just remember to max out the RAM...
-Smitty
Multithreading is different than multiprocessing. (Score:2)
MacOS multithreading/multiprocessing (Score:2)
MacOS supports both multithreading and multiprocessing [apple.com] using separate interfaces.
The multithreading support is a hold-over from the pre-PowerPC days. It provides cooperatively scheduled threads and may only work for M68K code. The multiprocessing support is from the period immediately preceeding the return of Steve Jobs. It was introduced to support the PowerMac 9500/ 180MP [everymac.com] and 9600/ 200MP [everymac.com], which had 2 processors, but it can be used on single processor machines as well. Threads created using multiprocessing services are preemtively scheduled, unlike almost everything else (aside from vertical retrace [apple.com] routines) on MacOS.
The downside of all three systems (thread manager, multiprocessing services, and vertical retrace manager) is that you are restricted in which OS calls are available to a thread/process/retrace routine. In general, you don't have access to certain parts of your applications memory space, you are not allowed to do anything which might cause memory to be allocated or rearranged[1] and you don't have much, if any, direct access to the GUI (you can calculate all kinds of stuff, but you can't interract with the user).
What this all comes down to is that you can make use of multiple processors using current versions of MacOS (all versions after at least 7.6 support the multiprocessing services) but the MacOS itself doesn't make use of more than one processor: you need to write your application to specifically use multiple processors. However, you can run multiprocessing targeted applications on single processor machines without any problem.
Hidden stories (Score:1)
Thread Manager (Score:2)
Hrmm...my browser seems to be caching a lot today
ls:
Multiprocessing API in MacOS 8/9 as well as Carbon (Score:1)
Thread v. Process (Score:2)
Pretty much, you can think of it like this:
multi-tasking = talking and chewing gum
multi-threading = holding a conversation while feeling someone up under the table with your feet
multi-processing = having two brains.
Multi-tasking came into the MacOS with Multifinder for System 6 and became integrated with the OS as of System 7. More than one application are open at once, but you only use one at a time.
Multi-threading was adopted with System 7.5. Background processes and by virtue of the fact that a mail app can check in the background while you're reading a page in a browser. Don't confuse OS-level multi-threading with Finder's ability to multi-thread (SpeedDoubler for System 7.5 and integrated in MacOS 8).
Multi-processing on the mac started with a few rare protoypes but became commercially available with the Daystar Genesis line of Mac clones. Since MacOS 8, multi--processing is supported but on an application level rather than system wide. Photoshop can make some use of a second processor, but with low efficiency. A system with two G4s - if properly assembled - wouldn't come near two G4 systems running separately.
OSX should herald a very efficient multi-processing system and a wide availability of multiprocessor configurations. However, nothing short of a Finder rewrite (ala MacOS 8) would really do much to help.
Re:Do you need it? (Score:1)
I'm the sysadmin for a student ACM chapter, and we're using mkLinux on a pair of old Macs for our DNS (including a fair number of domains owned by members). They're a bit on the slow side, but, hey, they're old macs. <g>
One of them is also running a web server, with a very old and out of date webpage, here [128.220.223.232].
Do you need it? (Score:2)
And last I checked, there is a well threaded and efficient OS [yellowdoglinux.org] for PowerPC and G3/G4.
Re:Do you need it? (Score:2)
I had thought that the MacOS multitasking, at least, was kind of a kludgey patch. Maybe I'm wrong, but the few times I've been on a Mac lately the only thing that happens when I try to multi-task is that it crashes.
Threading, I'd have to say definitely not; and while MacOS supports multiple processes, it is truly a kludge that was added on as an afterthought.
But....I just got a Performa 6116cd from a friend; I'm gonna go ahead now and try to put that there Yellow Dog on it; thanks for the lead! I can't wait to benchmark it against x86 boxen, since the tests I always see are skewed to the point of uselessness.
Re:Thread v. Process (Score:2)
Thanks!
Re:Do you need it? (Score:2)
Anyways, thanks for letting me know! I'm glad I'm not off on some wild goose chase tonight... ;-)
Comments from an actual Mac developer (Score:2)