Библиотека сайта rus-linux.net
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:
- 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.
- 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.
- Solaris strangeness. Not applicable to most other OS's.
- Signals are received on a per-thread basis, but threads share signal handlers for a given signal.
- 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.
- Multiprocessor systems only.
- 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].
- SIGIO and SIGALARM are multiplexed.
- There is a function "nthread_self()" to get the ID of the calling thread.
- 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] |