Thursday, July 30, 2009

THREAD
SINGLE THREADED PROCESS
A single thread can control the execution on a Maurer machine of any executable finite-state thread stored in the memory of the Maurer machine. We also relate stored threads with programs as considered in the program algebra of Bergstra et al. The work is intended as a preparation for the development of a formal approach to model micro-architectures and to verify their correctness and anticipated speed-up results.
MULTI-THREADED PROCESS
Multiple threads can be executed in parallel across many computer systems.
This is multithreading, and generally occurs by time slicing (similar to time-division multiplexing) across the computer systems. However, in a single processor environment, the processor 'context switches' between different threads. In this case, the processing is not literally simultaneous, for the single processor is really doing only one thing at a time. This switching can happen so fast as to give the illusion of simultaneity to an end user.

For instance, many PCs may only contain one processor core, but one can run multiple programs at once, such as typing in a document editor while listening to music in an audio playback program. Although the user experiences these things as simultaneous, in truth, the processor quickly switches back and forth between these separate processes. On a multiprocessor or multi-core system, now coming into general use, threading can be achieved via multiprocessing, where different threads and processes can run literally simultaneously on different processors or cores.

Threads exist within a process - every process has at least one thread, the 'main' thread. Threads share the process's resources, including memory and open files. This makes for efficient, but potentially problematic, communication.

No comments: