Linux Threads Home Page: How do Linux Threads compare with other OSs'?

How do Linux Threads compare with other OSs'?

Feature | Posix | Solaris | Win32 | Linux
|  |  |  | Kernel | BB | CL | DCE | FSU | JK | Lt | LWP | Nt | PCt | Pt | Qt | Rex
User-/Kernel-space | n/a | K&U | K | K | K | K | ? | U | K | K | U | U | U | U | U | U
Cancellation |  | - | - |  | - |  |  |  |  |  |  | - |  |  | - |
Priority Scheduling [1] |  |  |  |  | - | - |  |  |  |  |  | - |  |  | - |
Priority Inversion Handling [2] |  |  |  | ? | - | - |  |  |  | - | - | - |  |  | - |
Mutex Attributes |  |  | - | ? | - |  |  |  |  |  | - | - |  |  | - |
Shared and Private Mutexes |  |  | - | ? | - | - |  |  |  | - | - | - |  |  | - |
Thread Attributes |  |  | - |  | - |  |  |  |  |  |  | - |  |  | - |
Synchronization |  |  |  |  | - |  |  |  |  |  |  |  |  |  | - |
Stack Size Control |  |  |  |  |  |  |  |  |  | - |  |  |  |  | - |
Base Address Control [3] |  |  | - | n/a | - |  |  |  |  | - | - | - |  |  | - |
Detached Threads |  |  | - |  |  |  |  |  |  |  | - | - |  |  | - |
Joinable Threads |  |  | - |  | - |  |  |  |  |  | - |  |  |  | - |
Per-Thread Data Handling Functions |  |  |  |  | - |  |  |  |  |  |  | - |  |  | - |
Per-Thread Signal Handling |  |  |  |  |  |  |  |  |  | [4] | [8] | [4] |  |  | - |
Condition Variables |  |  | ? | ? | - |  |  |  |  |  | - |  |  |  | - |
Semaphores |  |  |  |  | - | - |  |  |  | - |  |  |  |  | - |
Thread ID Comparison |  |  | - |  | - | - |  |  |  |  |  | [9] |  |  | - |
Call-Once Functions |  |  | - |  | - | - |  |  |  |  | ? | - |  |  | - |
Thread Suspension [5] | - |  |  |  | - | - |  |  |  |  |  | - |  |  | - |
Specifying Concurrency | - |  | [6] | - | - | - |  |  |  | - | - | [10] |  |  | - |
Readers/Writer Share Locking [3] | - |  | - | - | - | - |  |  |  | - | - | - |  |  | - |
Processor-specific Thread Allocation | - | - |  | - | - | - |  |  |  | - | - | - |  |  | - |
Fork All Threads [7] | - |  | - |  | - | - |  |  |  | - |  | - |  |  | - |
Fork Calling Thread Only [7] |  |  | - | ? | - | - |  |  |  |  | - |  |  |  | - |

NOTES:

1. Linux kernel-space threads are processes and are not handled differently from fork'ed tasks (unlike most other multithreaded OS's). Therefore, process scheduling, cancelling, suspending, etc. is controlled via signals.
2. Posix and Solaris link thread priorities with mutexes and use the priority of a blocked thread's mutex to alter the priority of the blocking thread. Win32 and Linux let the scheduler determine what thread to elevate in priority.
3. Solaris strangeness. Not applicable to most other OS's.
4. Signals are received on a per-thread basis, but threads share signal handlers for a given signal.
5. Posix specifies no functionality for suspending and resuming threads. Solaris implements it because they need it: the program can change certain thread's attributes unless it is suspended.
6. Multiprocessor systems only.
7. Win32 has no direct equivalent to unix's fork() system call, but you can fake it with the CreateProcess() and CreateRemoteProcess() calls [and a little luck].
8. SIGIO and SIGALARM are multiplexed.
9. There is a function "nthread_self()" to get the ID of the calling thread.
10. You can specify how much user-level threads you will use at once. The number of kernel-level threads (i.e. concurrency level) is then determined as min([max number of threads to use],[number of available processors]).

[Previous Page] | [First Page] | [Dictionary] | [Email Author] | [Next Page]