June 18, 2011

What is Thread and Process?


All modern operating systems support multitasking by virtually . Java also support multithreaded programming. A multithreaded program contains two or more parts that can run concurrentlywhile
Java programs use the process-based multitasking environments. Multithreading is a specialized form of multitasking.
There are two types of multitasking: Thread-based and Process-based .
   Thread-based:
 A thread is a program which  defines a separate path of executionthe thread is the smallest unit of dispatchable code. This means that a single program can perform two or more tasks
simultaneously. Multitasking threads require less overhead than multitasking processes, Threads are lightweight, they share the same address space and cooperatively share the same heavyweight process while
Interthread communication is inexpensive and unlimited.
    
Process-based : 
A process is a program that is executingThus, process-based multitasking is the feature that allows your computer to run two or more program concurrently. Processes are heavyweight
tasks that require their own separate address spaces while Intercrosses communication is expensive and limited.

Multi processing means we can execute several programs at a time and Multi threading means executing diffrent parts of the program at a time
for example if we take we can open several pages at a time in multi threading and we can process only one page at a time with preference 5. The thread have the preference 1-10 normal preference given to any thread is 5.
where as in multi process we can open multiple pages and we can process all the pages at once.


No comments:

Post a Comment

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

My Favorite Site's List

#update below script more than 500 posts