Multithreading

841 views

Published on

Multithreading slides.

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
841
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
62
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Multithreading

  1. 1. MULTITHREADINGPRESENTED BYWAFA QAISER KHAN
  2. 2. DIFFERENCE BETWEEN TASK AND THREAD
  3. 3. •Most computers can only execute oneprogram instruction at a time, butbecause they operate so fast, theyappear to run many programs andserve many users simultaneously.•The computer operating system giveseach program a "turn" atrunning, then requires it to wait whileanother program gets a turn. Each ofthese programs is viewed by theoperating system as a task for whichcertain resources are identified andkept track of.
  4. 4. The operating system manages eachapplication program in your PC system(spreadsheet, word processor, Webbrowser) as a separate task.If the program initiates an I/Orequest, such as reading a file or writingto a printer, it creates a thread.
  5. 5. In a two state process model from timeto time the currently running processwill be interrupted and the dispatcherportion of the OS will select some otherprocess to run.The unit of dispatching is usuallyreferred to as a thread or lightweightprocess.
  6. 6. MULTITHREADING
  7. 7. Multithreading refers to the ability of anOS to support multiple, concurrent paths ofexecution within a single process.
  8. 8. SINGLE THREADED APPROACHES•MS-DOS supports a single user processand a single thread.•Some UNIX, support multiple userprocesses but only support one threadper process.
  9. 9. MULTITHREADED APPROACHES•Java run-time environment is a single processwith multiple threads•Multiple processes and threads are found inWindows, Solaris, and many modern versions ofUNIX
  10. 10. SINGLE THREADED ANDMULTITHREADED PROCESS MODELS
  11. 11. BENEFITS OF THREADS• It takes far less time to create a new thread than to create a brand-new process.• It takes less time to terminate a thread than a process• It takes less time to switch between two threads within the same process than to switch between processes.• Threads enhances efficiency in communication between different executing programs.
  12. 12. MULTITHREADING ON A UNIPROCESSOR
  13. 13. CONCLUSION•Threads are mini processes or lightweightprocesses.• They reside in the same address space andhave access to the same data.•It enhances efficiency.
  14. 14. THANKYOU

×