Previous 1 2 Next 18 Replies Latest reply: Jun 3, 2009 8:45 AM by a brody
IPEnthusiast Level 1 Level 1 (0 points)
I've recently read somewhere on the Web that Mac OS X has no concept of multithreadiing. I'm assuming from this that OS X uses some form of coarse-grained scheduling based on task/process. How does the Java VM run on OS X? Java apps rely on multithreading within the VM.

Thanks.

Windows Vista
  • Michael Black Level 6 Level 6 (18,880 points)
    Don't know where you got your information from, but Apple operating systems have been multithreaded since at least OS 8.
  • a brody Level 9 Level 9 (64,880 points)
    Mac OS 8 and 9 were multithreading in many tasks, but the application switching was not. Mac OS X offers multithreading at the application level. To see the extent of the threading, your Activity Viewer/Monitor utility (it was renamed with a certain version of Mac OS X) will show you all the separate tasks.
  • Courcoul Level 6 Level 6 (12,555 points)
    Since you sound like a knowledgeable programmer, I will assume you have installed or will install soon the Developer Tools package. When that is done, go into the /Developer/Applications/Performance Tools/ folder and run Thread Viewer. You will either attach it to an already-running application or use it to start a new application, after which you will get a window where you can see in real time all the threads being used by the chosen application, down to the specific code being executed. Knock yourself out...

    Side note: I'd suggest you register yourself on the [Apple Developer Connection|http://developer.apple.com> (there's a free registration option) so you can download the very latest version of the Developer Tools, as well as many other development goodies.
  • Allan Eckert Level 8 Level 8 (48,000 points)
    Hi IPEnthusiast;

    With OS X being based on Unix, I would have to say that it is multithreaded. It is most certainly more capable of multithreading then anything from M$.

    In the years of IT support that I have done, I can't believe how poorly Windows is at multithreading and utilizing multiple CPUs. So many times the customer would for Windows and later we would run Unix on the same server hardware and get significantly better perform simply by migrating off of Windows.

    Allan
    tiger
  • Topher Kessler Level 6 Level 6 (9,790 points)
    OS X is a fully multithread-aware operating system. The latest version of Java runs on it, and multithreaded java programs and applets are all fully functional, provided they dont require some OS-specific or hardware-specific resource.
  • a brody Level 9 Level 9 (64,880 points)
    The latest version of Java runs on it,


    Not quite true:

    http://www.javatester.org/version.html

    says the latest version for Mac OS X is:

    1.6.0_07-b06-153

    Yet

    1.6.0_14 is most current. Not that it matters in terms of multithreading, but facts are important.
  • varjak paw Level 10 Level 10 (169,810 points)
    The latest version of Java does run on Mac OS X 10.5. The fact that the latest version is not yet publicly available is a different matter. Just to clarify that it's an issue of release, not technical capability of the OS. As you say, facts are important.
  • IPEnthusiast Level 1 Level 1 (0 points)
    Well, simply because Mac OS X is based on UNIX, it can't be assumed that the OS is multithreaded. Multithreading is a concept that came around way after the first UNIX OSes were developed. And this actually manifested itself in earlier versions of the Linux kernel that simulated threads by actually launching a whole process in place of a thread, to take advantage of the process scheduler. Linux was firmly based on old UNIX code, I believe the implementation was called Minix.
  • Allan Eckert Level 8 Level 8 (48,000 points)
    Hi IPEnthusiast;

    You can have any opinion you want. It doesn't matter to me.

    I believe as do the others who have posted in reply to your question that Mac OS X is multithreaded. So unless you can produce some proof the the contrary, I am sticking by my original statement.

    Allan
    tiger
  • a brody Level 9 Level 9 (64,880 points)
    IPEnthusiast,

    When you open the Terminal, you can type

    ps -ax


    and list all the processes in Mac OS X as individual threads.

    When you read the website from Apple Developer, any programmer following Apple's guidelines will make at least Posix compliant threads if not Cocoa. There are naturally some issues with Carbon programming, stated here:

    http://www.macintouch.com/m10carbon.html

    So as long as you are running all non-legacy code, you should be good to go.
  • Michael Conniff Level 7 Level 7 (33,125 points)
    IPEnthusiast wrote:
    Well, simply because Mac OS X is based on UNIX, it can't be assumed that the OS is multithreaded. Multithreading is a concept that came around way after the first UNIX OSes were developed.


    Multithreading is mandated by Posix, and OS X 10.5 is fully Posix compliant. In fact it is UNIX 03 registered, and therefore it is Unix. See Mac OS X Leopard: Technology for more.

    If you want to know more about threads in OS X, try
    man 3 pthread

    And this actually manifested itself in earlier versions of the Linux kernel that simulated threads by actually launching a whole process in place of a thread, to take advantage of the process scheduler. Linux was firmly based on old UNIX code, I believe the implementation was called Minix.

    On the other hand, Linux and Minix were, and are, not Unix. Neither were "based on" old Unix code.
  • IPEnthusiast Level 1 Level 1 (0 points)
    And the robust combination of Windows Server/SQL Server has not figured atop the TPC OLTP benchmark with a poorly designed OS. While SQL Server itself uses its own scheduler, the underlying OS plays a very crucial part in how the database engine performs. Since the introduction of distributed partitioned views in SQL Server 2000, Microsoft has consistently blown the top off of the TPC benchmark. You just have to know how to tune these products.
  • a brody Level 9 Level 9 (64,880 points)
    Tune it as you might, but the security of such systems is always more suspect than Mac OS X. One virus, and any optimizations you realize will be out the window (if you pardon the pun).
  • Topher Kessler Level 6 Level 6 (9,790 points)
    "nightly builds" and other bleeding edge changes aside...
Previous 1 2 Next