Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Thread (computing)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Threads vs processes=== Threads differ from traditional [[computer multitasking|multitasking]] operating-system [[process (computing)|processes]] in several ways: * processes are typically independent, while threads exist as subsets of a process * processes carry considerably more [[state (computer science)|state]] information than threads, whereas multiple threads within a process share process state as well as [[computer storage|memory]] and other [[resource (computer science)|resources]] * processes have separate [[address space]]s, whereas threads share their address space * processes interact only through system-provided [[inter-process communication]] mechanisms * [[context switch]]ing between threads in the same process typically occurs faster than context switching between processes Systems such as [[Windows NT]] and [[OS/2]] are said to have ''cheap'' threads and ''expensive'' processes; in other operating systems there is not so great a difference except in the cost of an [[address space|address-space]] switch, which on some architectures (notably [[x86]]) results in a [[translation lookaside buffer]] (TLB) flush. Advantages and disadvantages of threads vs processes include: * ''Lower resource consumption'' of threads: using threads, an application can operate using fewer resources than it would need when using multiple processes. * ''Simplified sharing and communication'' of threads: unlike processes, which require a [[message passing]] or shared memory mechanism to perform [[inter-process communication]] (IPC), threads can communicate through data, code and files they already share. * ''Thread crashes a process'': due to threads sharing the same address space, an illegal operation performed by a thread can crash the entire process; therefore, one misbehaving thread can disrupt the processing of all the other threads in the application.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)