1 / 17

Adapting UNIX For A Multiprocessor Environment Using Threads

Adapting UNIX For A Multiprocessor Environment Using Threads. Group A3 Jonathan Sippel Jahanzeb Faizan Ka Hou Wong. Introduction. In the 1980’s, systems were developed with multiple processors UNIX was an ideal operating system (O/S) to adapt for these systems

kaia
Download Presentation

Adapting UNIX For A Multiprocessor Environment Using Threads

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Adapting UNIX For A Multiprocessor Environment Using Threads Group A3 Jonathan Sippel Jahanzeb Faizan Ka Hou Wong

  2. Introduction • In the 1980’s, systems were developed with multiple processors • UNIX was an ideal operating system (O/S) to adapt for these systems • Early implementations of multiprocessor UNIX were asymmetric • Scalability declined rapidly as additional processors were added

  3. The UNIX Process Model • UNIX is a multitasking environment i.e. several processes are active in the system concurrently • Processes contend for resources, with the UNIX kernel acting as a resource manager • Only one process can run at a time on the processor

  4. Limitations of the UNIX Process Model • Many applications need to: • Run independent tasks concurrently • Share a common address space • Share other resources • On traditional UNIX systems these applications must spawn multiple processes • A process cannot take advantage of a multiprocessor architecture because only one processor can be used at a time

  5. Improving the UNIX Process Model • A traditional process has a single thread of control • A multithreaded process is associated with one or more threads of control • Threads of control (threads) share the process instructions and most of the process data • Each thread executes independently

  6. P P CPU P P P time process P address space Improving the UNIX Process Model (cont’d)

  7. CPU time thread address space Improving the UNIX Process Model (cont’d)

  8. CPU CPU blocked CPU CPU blocked CPU time address space thread Improving the UNIX Process Model (cont’d)

  9. Multithreaded Systems • Parallelism – the actual degree of parallel execution achieved by an application. Limited by the number of available processors • Concurrency – the maximum parallelism an application can achieve using an unlimited number of processors

  10. Multithreaded Systems (cont’d) • The kernel provides system concurrency by recognizing multiple threads of control within a process • User-level thread libraries are used by applications to provide user concurrency • Each concurrency model is of limited value by itself • Many systems combine system and user concurrency to implement a dual concurrency model

  11. Kernel Threads • Do not need to be associated with a user process • Can be independently scheduled and use the standard synchronization mechanisms of the kernel • Used for performing synchronous I/O operations and to handle interrupts

  12. Lightweight Processes • A lightweight process (LWP) is a kernel-supported user thread • A system must support a kernel thread before it can support LWPs. • LWPs are independently scheduled and share the process address space • True parallelism exists on a multiprocessor system since each LWP can be scheduled to run on a separate processor

  13. K K K K K K K K K P P L L L L L thread scheduler CPU CPU CPU P process kernel thread L lightweight process address space Lightweight Processes (cont’d)

  14. User Threads • Thread abstraction can be provided entirely at the user level by library packages (e.g. POSIX p-thread and Mach c-thread libraries) • The libraries provide all the functions for creating, synchronizing, scheduling and managing threads • No special assistance is required from the kernel

  15. U U U U U U U U P P P CPU CPU user thread address space process P User Threads (cont’d)

  16. U U U U U U U U U L L L L L CPU CPU user thread address space L lightweight process User Threads (cont’d)

  17. Summary • Redesigning UNIX around threads has made it a more efficient O/S • Applications that need to perform several largely independent tasks concurrently, but must share a common address space, can now take advantage of UNIX thread facilities • By having multiple threads of control, UNIX applications can take advantage of the parallelism that a multiprocessor architecture provides

More Related