Section 1

Preview this deck

Which of the following instructions should only be allowed in kernel mode? 1. Disable all interrupts. 2. Read the time-of-the-day clock. 3. Change the memory map.

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (6)

Section 1

(6 cards)

Which of the following instructions should only be allowed in kernel mode? 1. Disable all interrupts. 2. Read the time-of-the-day clock. 3. Change the memory map.

Front

1 and 3

Back

Why would a thread ever voluntarily give up the CPU?

Front

Threads in a process cooperate. They are not hostile to one another. If yielding is needed for the good of the application, then a thread will yield. After all, it is usually the same programmer who writes the code for all of them.

Back

What is the biggest disadvantage of implementing threads in user space?

Front

Calling a blocking system call in a thread blocks all the threads.

Back

On all current computers, at least a part of the interrupt handlers are written in assembly language. Why?

Front

Generally, high-level languages do not allow one the kind of access to CPU hardware that is required. For instance, an interrupt handler may be required to enable and disable the interrupt servicing a particular device, or to manipulate data within a process' stack area. Also, interrupt service routines must execute as rapidly as possible.

Back

What is the biggest advantage of implementing threads in user space?

Front

More efficient. The biggest advantage is that context switching between threads is faster because it does not require a trap into the kernel.

Back

Can a thread be preempted by a clock interrupt? If so, under which conditions? If not, why not?

Front

User-level threads cannot be preempted by the clock unless the whole process' quantum has been used up. Kernel-level threads can be preempted individually. In the latter case, if a thread runs too long, the clock will interrupt the current process and thus the current thread. The kernel is free to pick a different thread from the same process to run next if it so desires.

Back