|
Thread
A thread in computer science is short for a thread of execution. Threads are a way for a program to split itself into two or more simultaneously (or pseudo-simultaneously) running tasks. more...
Home
Bead Art
General Art & Craft Supplies
Knitting
Lacemaking, Tatting
Latch Rug Hooking
Sewing
Sewing Machine Accessories
Sewing Machines & Sergers
Sewing Notions & Tools
Bows & Flowers
Buttons
Gold Buttons
Metal Buttons
Other Buttons
Pearl Buttons
Plastic Buttons
Shell Buttons
Other Sewing Supplies
Sewing Needles
Sewing Pincushions
Sewing Pins
Sewing Storage, Boxes
Sewing Trims
Braid
Cord
Elastic
Embroidered
Jacquard
Lace
Other Sewing Trims
Venise
Shears, Scissors
Thread
Zippers
Sewing Patterns
Threads and processes differ from one operating system to another, but in general, the way that a thread is created and shares its resources is different from the way a process does.
Multiple threads can be executed in parallel on many computer systems. This multithreading generally occurs by time slicing, wherein a single processor switches between different threads, in which case the processing is not literally simultaneous, for the single processor is only really doing one thing at a time. This switching can happen so fast as to give the illusion of simultaneity to an end user. For instance, a typical PC today contains only one processor, but you can run multiple programs at once, such as a word processor alongside an audio playback program; though the user experiences these things as simultaneous, in truth, the processor is quickly switching back and forth between these separate threads. On a multiprocessor system, threading can be achieved via multiprocessing, wherein different threads can run literally simultaneously on different processors.
Many modern operating systems directly support both time-sliced and multiprocessor threading with a process scheduler. The operating system kernel allows programmers to manipulate threads via the system call interface. Some implementations are called a kernel thread, whereas a lightweight process is a specific type of kernel thread that shares the same state and information.
Absent that, programs can still implement threading by using timers, signals, or other methods to interrupt their own execution and hence perform a sort of ad hoc time-slicing. These are sometimes called user-space threads.
An unrelated use of the term thread is for threaded code, which is a form of code consisting entirely of subroutine calls, written without the subroutine call instruction, and processed by an interpreter or the CPU. Two threaded code languages are Forth and early B programming languages.
Threads compared with processes
Threads are distinguished from traditional multi-tasking operating system processes in that processes are typically independent, carry considerable state information, have separate address spaces, and interact only through system-provided inter-process communication mechanisms. Multiple threads, on the other hand, typically share the state information of a single process, and share memory and other resources directly. Context switching between threads in the same process is typically faster than context switching between processes. Systems like Windows NT and OS/2 are said to have \"cheap\" threads and \"expensive\" processes, while in other operating systems there is not so great a difference.
Read more at Wikipedia.org
|
|