Author:drivermonkey
Mail:[email protected]
phone:13410905075
qq:196568501
is Linux threads the same as other implementations?
No. They is better-while mostly keeping the same API. As stated above, most multithreaded OSs define a thread separately from processes. Linus Torvalds has defined, a thread is a "context of execution" (COE). This means, one process/thread table and one scheduler is needed. Also The scheduler have been optomized so, the switching time for threads vs. tasks varies little--about 1.7us (threads ) and 1.8us (fork) on a 75MHz Pentium.
Traditionally, a thread is just a CPU (and some other minimal state), and the process containing the remains (data, Stack, I/O, signals). This would lend itself to very fast switching but would cause basic problems (e.g. "fork ()" or "Execve ()" Calls me An when executed by a thread?).
Consider Linux threads as a superset of this functionality:they still can switch fast and share process parts, but they c An also identify what parts get shared and has no problems with EXECVE () calls. There is four flags, that determine, the level of sharing:
What is the difference between a Linux thread switching efficiency and process switching efficiency?