Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Brisaac Johnson

University of North Georgia


Mike Cottrell College of Business
Department of Computer Science & Information Systems
CSCI 4100 Operating Systems/File Organization (Spring 2019)
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.

2. (4 points) Describe the differences among short-term, medium-term, and long-term


scheduling.
Short term also known as the CPU scheduler, will select jobs from the memory that are ready
to be executed and allocates them to the CPU. Medium term is used with time sharing as a
scheduling level. A swapping scheme is then implemented to remove partial running programs
from the memory and then reinstates, programs and the programs pick up where they left off.
Long term also known as job scheduler, determines which job will be loaded into the memory
to be processed.

3. (4 points) Describe the actions taken by a kernel to context-switch between processes.


The operating system must save each state of the current running process and restore the
process of the next scheduled process that is set to be ran. Saving each state usually includes
the values if all CPU registers along with memory allocation. Context switches will have to
carry out many system specific tasks including clearing out data and instruction caches.

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

-Due to a blocking send, messages may be delivered asynchronously. Due to a


rendezvous not being required.

b) Automatic and explicit buffering


Automatic Buffering:

1. Advantage - Sender will never have to block and wait

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.

c) Send by copy and send by reference

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

d) Fixed-sized and variable-sized messages

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.

You might also like