Exec SO
Exec SO
Exec SO
b)
I/O first and fourth quarters, processor second and third quarter
2. An I/O-bound program is one that, if run alone, would spend more time waiting
for I/O than using the processor. A processor-bound program is the opposite.
Suppose a short-term scheduling algorithm favors those programs that have
used little processor time in the recent past. Explain why this algorithm favors
I/O-bound programs and yet does not permanently deny processor time to
processor-bound programs.
3. Contrast the scheduling policies you might use when trying to optimize a timesharing system with those you would use to optimize a multiprogrammed batch
system.
4. What is the purpose of system calls, and how do system calls relate to the OS
and to the concept of dual-mode (kernel mode and user mode) operation?
Threads - Problems
1. It was pointed out that two advantages of using multiple threads within a
process are that (1) less work is involved in creating a new thread within an
existing process than in creating a new process, and (2) communication
among threads within the same process is simplified. Is it also the case
that a mode switch between two threads within the same process involves
less work than a mode switch between two threads in different processes?
2. In the discussion of ULTs versus KLTs, it was pointed out that a
disadvantage of ULTs is that when a ULT executes a system call, not only is
that thread blocked, but also all of the threads within the process are
blocked. Why is that so?
3. Consider an environment in which there is a one-to-one mapping between
user-level threads and kernel-level threads that allows one or more threads
within a process to issue blocking system calls while other threads continue
to run. Explain why this model can make multithreaded programs run faster
than their single-threaded counterparts on a uniprocessor computer.
LEWI96-42
4. If a process exits and there are still threads of that process running, will
they continue to run? LEWI96-42
Exercises 7.1, 7.2 ... 7.6, 7.12, 7.13 (sixth Edition Stallings)
Valid bit
Reference Bit
Modify Bit
Page frame#
a)
b)
1052
(ii)
2221
(iii)
5499
Assume that the replacement algorithm is first-in-first-out and find the number
of page transfers during this sequence of references starting with an empty main
memory with three page frames. Repeat for four page frames.
3. A process contains eight virtual pages on disk and is assigned a fixed allocation
of four page frames in main memory.The following page trace occurs:
1, 0, 2, 2, 1, 7, 6, 7, 0, 1, 2, 0, 3, 0, 4, 5, 1, 5, 2, 4, 5, 6, 7, 6, 7, 2, 4, 2, 7, 3, 3, 2, 3
a)
Show the successive pages residing in the four frames using the LRU
replacement policy. Compute the hit ratio in main memory.Assume that the
frames are initially empty.
b)
c)
Compare the two hit ratios and comment on the effectiveness of using FIFO
to approximate LRU with respect to this particular trace.
b)
What is the length and width of the page table (disregarding the access
rights bits)?
c)
What is the effect on the page table if the physical memory space is reduced
by half?
Frame number
101011
111100
110011
011010
010101
Limit
111011100101
1010111100001111
000100011010
1111000011001100
101010101010
1100111011001110
111101011111
0110101110101110
111000111000
0101010111111011
a)
b)
c)
d)
e)
2375
19366
30000
256
16385
Consider a computer system with a 32-bit logical address and 4-KB page size . The
system supports up to 512MB of physical memory. How many entries are there in a
page table?