Thread: Difference between revisions

44 bytes removed ,  15 years ago
m
Reorg, wp link
(Forking is not multi-threading)
m (Reorg, wp link)
Line 1:
[[Category:Encyclopedia]]A '''thread''' is a particular flow of control within a [[process]]. A thread shares the address space with other threads in the same process, but each thread gets its own call stack and set of registers. Switching between threads within a process is a much lighter-weight operation than switching between processes. Threads can by ''native'' (provided by the [[:Category:Operating Systems|operating system]]) or ''green'' (an abstraction provided solely by the language or threading library). [[Erlang]] and [[Forth]] provide their own threading mechanisms, and [[Java]] VMs can often be configured to use either native or green threading.
 
Programs can be "[[Simple concurrent actions|multi-threaded]]", where certain parts of the programs will compete for system resources. ThreadsA are useful for servers, where each client connecting to a server will "spawn" a new thread for its own operations. Amulti-threaded program can also run multiple operations concurrently, also known as [[Simple concurrent actions|multi-threading]]. With single-core processors, multi-threading does not usually provide much of an advantage, but with multiple cores, a computer can run the threads concurrently and do multiple programs' work at once.
 
Threads are useful for servers, where each client connecting to a server will "spawn" a new thread for its own operations.
 
One of the best known threading abstractions is '''[[POSIX]] threads''' (pthreads), which are widely used on [[UNIX]]-like systems.
 
==See also==
* [http[wp://en.wikipedia.org/wiki/Thread_%28computer_science%29 |Wikipedia]]
Anonymous user