4. 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.
5. 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.
6. 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.
8. 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
9. 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
10. 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.
11. 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.