Professional Documents
Culture Documents
Assignment 3
Assignment 3
1. (4 points) 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?
If the context is in memory, one of the contexts in the register will be selected then moved
into the memory and the new context will need to be loaded into the set.
4. (4 points) 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.
An Example were ordinary pipes are well suited, is Simple commutation, this is can be proven
by looking at a process that counts characters in a class. A ordinary pipe allows the producer
to write a file to the pipe and the consumer reads the files and then counts the characters in
the file. Named pipes are well suited when you have multiple processors that want to write to
a log. If a process wants to write a message to the log, the need only to write to the named
pipe, a server will then read the messages from the named pipe and then write it to the log.
5. (4 points) What are the benefits and the disadvantages of each of the following?
a) Synchronous and asynchronous communication
Advantages:
-allows a rendezvous (when blocking send and blocking receive communication is
used.) between the sender and receiver
Disadvantages:
Brisaac Johnson
2. Disadvantage – requires a lot of memory space [you don’t want the buffer being
overloaded]
Explicit Buffering:
1. Advantage- Set memory space so you don’t have to worry about space
[requires less storage]
2. Disadvantage-If the buffer is full then the Sender must wait until the consumer
has consumed the messages.
Advantage:
- (Send by reference) Allows the receiver to alter the state of the parameter,
- (Send by reference) Allows the programmer to write to a distributed version of
a centralized application
Disadvantage:
- (Send by copy) Doesn’t allow the receiver to alter the state of the parameter
Advantage:
- (Fixed-sized) A buffer size is known and can hold a specific number of
messages.
- (Variable Sized) uses shared memory to pass messages which is faster.
Disadvantage:
- (Variable sized) the size of the buffer is unknown.