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!
==Programming language support== Many programming languages support threading in some capacity. * IBM [[PL/I]](F) included support for multithreading (called ''multitasking'') as early as in the late 1960s, and this was continued in the Optimizing Compiler and later versions. The IBM Enterprise PL/I compiler introduced a new model "thread" API. Neither version was part of the PL/I standard. * Many implementations of [[C (programming language)|C]] and [[C++]] support threading, and provide access to the native threading APIs of the operating system. A standardized interface for thread implementation is [[POSIX Threads]] (Pthreads), which is a set of C-function library calls. OS vendors are free to implement the interface as desired, but the application developer should be able to use the same interface across multiple platforms. Most [[Unix]] platforms, including Linux, support Pthreads. Microsoft Windows has its own set of thread functions in the [[process.h]] interface for multithreading, like [[beginthread]]. * Some [[high-level programming language|higher level]] (and usually [[cross-platform]]) programming languages, such as [[Java (programming language)|Java]], [[Python (programming language)|Python]], and [[.NET Framework]] languages, expose threading to developers while abstracting the platform specific differences in threading implementations in the runtime. Several other programming languages and language extensions also try to abstract the concept of concurrency and threading from the developer fully ([[Cilk]], [[OpenMP]], [[Message Passing Interface]] (MPI)). Some languages are designed for sequential parallelism instead (especially using GPUs), without requiring concurrency or threads ([[Ateji PX]], [[CUDA]]). * A few interpreted programming languages have implementations (e.g., [[Ruby MRI]] for Ruby, [[CPython]] for Python) which support threading and concurrency but not parallel execution of threads, due to a [[global interpreter lock]] (GIL). The GIL is a mutual exclusion lock held by the interpreter that can prevent the interpreter from simultaneously interpreting the application's code on two or more threads at once. This effectively limits the parallelism on multiple core systems. It also limits performance for processor-bound threads (which require the processor), but doesn't effect I/O-bound or network-bound ones as much. Other implementations of interpreted programming languages, such as [[Tcl]] using the Thread extension, avoid the GIL limit by using an Apartment model where data and code must be explicitly "shared" between threads. In Tcl each thread has one or more interpreters. * In programming models such as [[CUDA]] designed for [[data parallel computation]], an array of threads run [[compute kernel|the same code]] in parallel using only its ID to find its data in memory. In essence, the application must be designed so that each thread performs the same operation on different segments of memory so that they can operate in parallel and use the GPU architecture. * [[Hardware description language]]s such as [[Verilog]] have a different threading model that supports extremely large numbers of threads (for modeling hardware).
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)