Академический Документы
Профессиональный Документы
Культура Документы
Yun 65035200 1
CS 143a S16
1. Question 1: Polling, Interrupts and Traps
a. Polling is a low level process where CPU will periodically check external hardware
to check the current state of that service. Interrupts on the other hand, are
signals by processes to the processor alerting that I/O is available or a higher
priority process is required to run before other ones. Polling is different because
it requires overhead to continuously check I/O on a time basis. When no
requests are queued, polling still takes place. Interrupts are slightly more
efficient because it will send a signal once i/o is finished. Only one check
happens versus the periodic checks made by polling.
b. 60 Words/min * 4chars/word *min/60sec = 4 chars a second.
4 chars/second * second/1 Billion. Every 4 chars, 1 Billion instructions are
executed. Thus, 250 million instructions are executed during the time one char
is typed
c. Asynchronous I/O is interrupt driven. A signal is dispatched when I/O has
finished
d. Trap: Software generated interrupt caused by an error or user request
Interrupt is a lower level signal generated by hardware rather than an error or
user driven signal.
2. Question 2: Parallel, Distributed, Real-Time Systems
a. Timesharing is an equal based system to run multiple programs. A timer is set
and when the timer hits 0, an interruption occurs to swap processes.
Multiprogramming also uses interrupts, but dont have a timer. Programs run
until an interruption from another process occurs.
b. Network routers are distributed systems. They require multiple routers to be set
up so that way computers on different networks can transmit data from one
network to another. Each router has the same goal but runs in different
locations, despite running the same task.
Multiplayer Video Games also have distributed computing. Multiple servers will
be set up to process many users requests. Although many servers exist, each
server works to process and send the players moves, etc across to other players
so that multiple game rooms can be running at the same time.
c. Hard/Soft real time
Spotify
Soft real time
Android System Interface
Hard real time
Adaptive Cruise Control
Hard Real time
HiFreq Stock Trading
Hard Real Time
Spotify is soft real time as it does not require precise time precision to execute
requests.
Android OS should be hard real time, as it needs to be able to accept calls and
notifications in real time.
Cruise control needs to be hard real time so that it can adapt to environmental
changes in real time, for the safety of the passengers