• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Thread management
 

Thread management

on

  • 1,483 views

how operating system works's....

how operating system works's....

Statistics

Views

Total Views
1,483
Views on SlideShare
1,483
Embed Views
0

Actions

Likes
0
Downloads
14
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Thread management Thread management Presentation Transcript

    • adeel_tc@hotmail.com 0315-4632432 1
    • adeel_tc@hotmail.com 0315-4632432 2
    •  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
    • THREADS adeel_tc@hotmail.com 0315-4632432 4
    •  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
    •  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
    • 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
    • THREADS Many-to-One One-to-One Many-to-Many adeel_tc@hotmail.com 0315-4632432 8
    • 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
    • THREADS Each user-level thread maps to kernel thread. Examples - Windows 95/98/NT/2000 - Linux adeel_tc@hotmail.com 0315-4632432 10
    •  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
    • adeel_tc@hotmail.com 0315-4632432 12
    • adeel_tc@hotmail.com 0315-4632432