Thread management

1,984 views
1,841 views

Published on

how operating system works's....

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

  • Be the first to like this

No Downloads
Views
Total views
1,984
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
34
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Thread management

  1. 1. adeel_tc@hotmail.com 0315-4632432 1
  2. 2. adeel_tc@hotmail.com 0315-4632432 2
  3. 3.  process: • an address space with 1 or more threads executing within that address space, and the required system resources for those threads • a program that is running thread: • a sequence of control within a process • shares the resources in that process adeel_tc@hotmail.com 0315-4632432 3
  4. 4. THREADS adeel_tc@hotmail.com 0315-4632432 4
  5. 5.  Advantages: • the overhead for creating a thread is significantly less than that for creating a process • multitasking, i.e., one process serves multiple clients • switching between threads requires the OS to do much less work than switching between processes adeel_tc@hotmail.com 0315-4632432 5
  6. 6.  Drawbacks: • not as widely available as longer established features • writing multithreaded programs require more careful thought • more difficult to debug than single threaded programs • for single processor machines, creating several threads in a program may not necessarily produce an increase in performance (only so many CPU cycles to be had) adeel_tc@hotmail.com 0315-4632432 6
  7. 7. THREADS Thread management done by user-level threads library Examples - POSIX Pthreads - Mach C-threads - Solaris threads• Supported by the Kernel• Examples - Windows 95/98/NT/2000 - Solaris - Tru64 UNIX - BeOS - Linux adeel_tc@hotmail.com 0315-4632432 7
  8. 8. THREADS Many-to-One One-to-One Many-to-Many adeel_tc@hotmail.com 0315-4632432 8
  9. 9. THREADS Many user-level threads mapped to single kernel thread. Used on systems that do not support kernel threads. Examples: Solaris Green Threads GNU Portable Threads adeel_tc@hotmail.com 0315-4632432 9
  10. 10. THREADS Each user-level thread maps to kernel thread. Examples - Windows 95/98/NT/2000 - Linux adeel_tc@hotmail.com 0315-4632432 10
  11. 11.  In this model, the library has two kinds of threads: bound and unbound  bound threads are mapped each to a single lightweight process  unbound threads may be mapped to the same LWP Probably the best of both worlds Used in the Solaris implementation of Pthreads (and several other Unix implementations) adeel_tc@hotmail.com 0315-4632432 11
  12. 12. adeel_tc@hotmail.com 0315-4632432 12
  13. 13. adeel_tc@hotmail.com 0315-4632432

×