banner



Why Does Each Thread Need Its Own, If There Is Only One Register Set In The Cpu?

Written Assignment 2

CS 4352 Operating Systems

Fall 201vi

Q1. (Chapter 2, Problem 1)In Fig. two-2, iii process states are shown. In theory, with three

states, at that place could be six transitions, two out of each country. However, only iv transitions are

shown. Are there any circumstances in which either or both of the missing transitions might

occur?

A:The transition from blocked to running is conceivable. Suppose that a process is blocked on I/O and

the I/O finishes. If the CPU is otherwise idle, the process could go directly from blocked to running. The

other missing transition, from gear up to blocked, is impossible. A set process cannot do I/O or annihilation

else that might block it. Only a running process can block.

Q2. (Affiliate two, Modified Problem five).Multiple jobs tin run in parallel and stop faster than if

they had run sequentially. Suppose that ii jobs, each of which needs 5 minutes of CPU time,

start simultaneously. How long will the last one take to complete if they run sequentially? How

long if they run in parallel? Assume 20% I/O expect.

A: If each job has 20% I/O wait, then it will take v/0.eight=six.25 minutes to complete in the absence

of competition. If run sequentially, the second i will finish 12.five minutes after the first one

starts. With two jobs, the approximate CPU utilization is i~ 0.2^two=0.96. Thus each one gets 0.48

CPU minute per minute of real time. To accumulate 5 minutes of CPU time, a job must run for

5/0.48 minutes, or about 10.41 minutes. Thus running sequentially the jobs end afterwards 12.5

minutes, but running in parallel they finish later ane0.41 minutes.

v/0.8=6.25

six.25*two=12.five

5/0.48=x.41

Q3. (Chapter 2, Trouble viii). In Fig. 2-eight, a multithreaded Web server is shown. If the simply way

to read from a file is the normal blocking read system phone call, practise you think user-level threads or

kernel-level threads are existence used for the Spider web server? Why?

A: A worker thread will cake when it has to read a Web page from the disk. If user-level threads

are being used, this activeness will cake the entire procedure, destroying the value of multithreading.

Thus it is essential that kernel threads are used to permit some threads to block without affecting

the others.

Q4. (Chapter ii, Problem ten).In Fig. 2-12 the annals prepare is listed as a per-thread rather than a

Why Does Each Thread Need Its Own, If There Is Only One Register Set In The Cpu?,

Source: https://www.studocu.com/en-us/document/texas-tech-university/operating-systems/written-assignment-for-cs4352-operating-systems-past-exams/855040

Posted by: smithgoidesseem.blogspot.com

0 Response to "Why Does Each Thread Need Its Own, If There Is Only One Register Set In The Cpu?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel