♠ Posted by Unknown in
Core Java
Multithreaded
Programming in Java
Multithreading
is a conceptual programming paradigm where a program (process) is divided into
two or more subprograms (processes), which can be implemented at the same time
in parallel. For example, one subprogram can display an animation on the screen
while another may build the next animation to be displayed. This is something
similar to dividing a task into subtasks and assigning them to different people
for execution independently and simultaneously.
A
thread is similar to a program that has a single flow of control. It has a
beginning, a body, and an end, and executes commands sequentially. In fact all
main programs can be called single-threaded programs.
The
main thread is actually the main method module, which is designed to create and
start the other three threads, namely A, B, and C.
Once
initiated by the main thread, the threads A, B, and C run concurrently and
share the resources jointly. The ability of a language to...