Effective Java

August 18, 2014

A thread of execution, operating systems, a feature that allows an application to perform several tasks concurrently. The different threads of execution share a number of resources such as memory space, open files, authentication status, etc.. This technique simplifies the design of an application that must perform several functions simultaneously.
Threads of execution that share the same resources, in addition to these resources are collectively known as a process. The fact that the execution threads of a process share the same resources makes any of these threads can modify these. When one thread modifies a data in memory, other threads accessing the changed data immediately.
What is unique to each thread is the program counter, stack and execution state of the CPU (including the value of the records).
The process continues execution until at least one of its threads of execution to remain active. When the process ends, all threads have completed execution too. Also at the time that all threads finish execution, the process no longer exists and all its resources are released.
Some programming languages have design features created specifically to enable programmers to deal with threads of execution (such as Java or Delphi). Others (most) are unaware of execution threads, and these should be created through special library calls that depend on the operating system on which these languages are being used (such as C and C).
An example of the use of threads is a thread close to the graphical interface (icons, buttons, windows), while another thread a long operation internally. In this way the program to respond more nimbly to user interaction. They can also be used by a server application to service multiple clients.


Filed under:
General by david

Comments are closed.