Multi threading models

797 views 12 slides May 04, 2021
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

Advanced Operating System


Slide Content

Advance Operating system Darakhshan Nayab MSc(IT) MS(Computer Science) Dept of Computer Science

Content Multi-threading
Example Architecture RPC
Advantages Multi-threading models

Multi-threading Multithreading allows operating system to execute different threads simultaneously. It perform multiple tasks at the same time.

Example Many software packages that run on modern desktop PCs are multithreaded. A word processor may have: A thread for displaying graphics, another thread for responding to keystrokes from the user, and a third thread for performing spelling and grammar checking in the background. A Web Browser can use one thread to display images and a second thread to retrieve data from the network.

Architecture A web server receives requests for web pages, images and sounds etc. Many client may be accessing the server at the same time. The web server can service only one client at a time if it runs as a single-threaded process. The clients may have to wait for the service of the requests.

RPC RPC is a protocol in which one program can be used to send the service to the program located in another server in a network without having the network detail.

Advantages Responsiveness Resource sharing Economy Scalability Context Switching is smooth

Multi-Threading Models The user threads must be mapped to kernel threads, by one of the following strategies:
Many to One Model
One to One Model
Many to Many Model

One to One Model One to One model creates a separate kernel thread to handle each and every user thread.
Most implementations of this model place a limit on how many threads can be created. This model provides more concurrency, Efficient performance. Example Linux Window XP

Many to One In the many to one model, many user-level threads are all mapped onto a single kernel thread. Thread management done in user space.
If a thread makes a blocking calls entire process is blocked. Only one thread can access the kernel at a time, So it cannot run in parallel on multiprocessor.

Many to Many Multiplexes any number of user threads onto an equal or smaller number of kernel threads, combining the best features of the one-to-one and many-to-one models. Users can create any number of threads.
Blocking the kernel system calls does not block the entire process.
Processes can be split across multiple processors.
Tags