Thread (computing): Difference between revisions

Content deleted Content added
No edit summary
m copyedit
Line 8:
Systems like [[Windows NT]] and [[OS/2]] are said to have "cheap" threads and "expensive" processes, while in systems like [[Linux]] there is not so big a difference.
 
An advantage of a multi-threaded program is that it can operate faster on [[computer system]]s that have multiple [[CPU]]s, or across a [[computer cluster|cluster]] of machines. This is because the threads of the program naturally lend themselves for truly [[concurrent programming|concurrent]] [[execution (computers)|execution]]. In such a case, the [[programmer]] needs to be careful to avoid [[race condition]]s, and other non-intuitive [[behavior]]sbehaviors. In order for data to be correctly manipulated, threads will often need to [[rendezvous]] in time in order to process the data in the correct order. Threads may also require [[Atomic_(computer_science)|atomic]] operations (often implemented using [[semaphore (programming)|semaphores]]) in order to prevent common data from being simultaneously modified, or read while in the process of being modified. Careless use of such [[primitive]]s can lead to [[deadlock]]s.
 
Use of threads in [[programming]] often causes a [[state inconsistency]]. A common [[anti-pattern]] is to set a [[global variable]], then invoke [[subprogram]]s that depend on its value. This is known as ''[[accumulate and fire]]''.
 
The [[Java programming language]] is an example of a [[computer language]] which supports multi-threaded [[computer program|program]]s.
 
AHardware relativelysupport newfor [[concept]]software threads is provided by [[simultaneous multithreading]],. This thatfeature was introduced in [[Intel]]'s [[Pentium 4]] 3.06 GHz processor, with the name of ''[[Hyper-threading]]''.
 
'''See also:'''
Line 22 ⟶ 26:
* [[SR language]]
* [[OpenMP]]
 
The [[Java programming language]] is an example of a [[computer language]] which supports multi-threaded [[computer program|program]]s.
 
A relatively new [[concept]] is [[simultaneous multithreading]], that was introduced in [[Intel]]'s [[Pentium 4]] 3.06 GHz processor, with the name of [[Hyper-threading]]
 
----
 
SeeAn [[threadedunrelated code]]use forof the [[Forthterm programming'''thread''' language|Forth]]is and earlyfor [[Bthreaded programming languagecode]]s, meaningwhich is a form of code consisting entirely of [[subroutine]] calls, written without the subroutine call instruction, and processed by an [[interpreter (computing)|interpreter]] or the CPU. Two threaded code languages are [[Forth programming language|Forth]] and early [[B programming language]]s.
 
== External links ==