• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/5

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

5 Cards in this Set

  • Front
  • Back

The Sun ultraSPARC processor has multiple register sets. Describe what happens when a context switch occurs if the new context is already
loaded into one of the register sets. What happens if the new context is
in memory rather than in a register set and all the register sets are in


use?

The CPU current-register-set pointer is changed to point to the
set containing the new context, which takes very little time. If the context
is in memory, one of the contexts in a register set must be chosen and be
moved to memory, and the new context must be loaded from memory
into the set. This process takes a little more time than on systems with
one set of registers, depending on how a replacement victim is selected.

Describe the differences among short-term, medium-term, and longterm scheduling.

* Short-term (CPU scheduler): selects a process from those that are in memory and ready to execute, and and allocates the CPU to it.
* Medium-term (memory manager): selects processes from the ready or blocked queue and removes them from memory, then reinstates them later to continue running.
* Long-term (job scheduler): determines which jobs are brought into the system for processing.

Describe the actions taken by a kernel to context-switch between processes.

* The thread context (registers, PC, and stack, plus accounting info if appropriate) must be saved and another thread's context must be loaded.
* The same as (a), except that the memory and resource info must also be stored and that for the next process must be loaded.

Give an example of a situation in which ordinary pipes are more suitable than named pipes and an example of a situation in which named pipes
are more suitable than ordinary pipes.

Simple communication works well with ordinary pipes. For
example, assume we have a process that counts characters in a file. An
ordinary pipe can be used where the producer writes the file to the pipe
and the consumer reads the files and counts the number of characters
in the file. Next, for an example where named pipes are more suitable,
consider the situation where several processes may write messages to a
log. When processes wish to write a message to the log, they write it to
the named pipe. A server reads the messages from the named pipe and
writes them to the log file.

What are the benefits and the disadvantages of each of the following? Consider both the system level and the programmer level.
a. Synchronous and asynchronous communication
b. Automatic and explicit buffering


c. Send by copy and send by reference
d. Fixed-sized and variable-sized messages

A. Synchronous and asynchronous communication—A benefit of synchronous
communication is that it allows a rendezvous between the sender and receiver. A
disadvantage of a blocking send is that a rendezvous may not be required and the
message could be delivered asynchronously. As a result, message-passing systems
often provide both forms of synchronization.
B. Automatic and explicit buffering—Automatic buffering provides a queue with
indefinite length, thus ensuring the sender will never have to block while waiting to
copy a message. There are no specifications on how automatic buffering will be
provided; one scheme may reserve sufficiently large memory where much of the
memory is wasted. Explicit buffering specifies how large the buffer is. In this situation,
the sender may be blocked while waiting for available space in the queue. However, it
is less likely that memory will be wasted with explicit buffering.
C. Send by copy and send by reference—Send by copy does not allow the receiver to
alter the state of the parameter; send by reference does allow it. A benefit of send by
reference is that it allows the programmer to write a distributed version of a centralized
application. Java’s RMI provides both; however, passing a parameter by reference
requires declaring the parameter as a remote object as well.
D. Fixed-sized and variable-sized messages—The implications of this are mostly related
to buffering issues; with fixed-size messages, a buffer with a specific size can hold a
known number of messages. The number of variable-sized messages that can be held
by such a buffer is unknown. Consider how Windows 2000 handles this situation: with
fixed-sized messages (anything < 256 bytes), the messages are copied from the address
space of the sender to the address space of the receiving process. Larger messages (i.e.
variable-sized messages) use shared memory to pass the message.