Section 3: Software Synchronization Flashcards

1
Q

Define CPU latency

A

Time between the receipt of a service request and the initiation of the service. Can involve both hardware and software delays.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define real-time system

A

A system that guarantees a worst-case latency for critical events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define latency

A

The delay between the arrival of the request and the completion of service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are two terms that are used in discussing system performance?

A

Latency and Throughput

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define throughput

A

A measure of how many items can be processed per unit of time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define blind cycle

A

Software waits for some amount of time Ned then acts on the data whether or not the device is ready

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define periodic polling

A

Device status is checked after a pre-determined amount of time and this repeats until the device is done. Usually implemented with a timer interrupt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define occasional polling

A

Device status is checked at the convenience of the designer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define tight polling loop (gadfly or busy waiting)

A

Software continually checks the I/O status, waiting for the device to be done.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define interrupt handling

A

Device generates a hardware interrupt to request servicing when done.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Name 5 synchronization mechanisms

A
  1. Blind cycle
  2. Periodic polling
  3. Occasional polling
  4. Tight polling
  5. Interrupt handling.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which 3 synchronization mechanisms are CPU-orientated?

A
  1. Blind cycle
  2. Periodic polling
  3. Occasional polling

Synchronization is dependant primarily on CPU timing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

List 2 synchronization mechanics that are device-orientated

A
  1. Tight polling
  2. Interrupt handling

Latency seen by the device is minimized.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain the steps in input polling loop synchronization

A
  1. Poll the device
  2. Wait until data is available
  3. Input the data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Explain the steps in output polling loop synchronization

A
  1. Poll the device
  2. Wait until device is ready
  3. Output data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain the steps in interrupt synchronization

A
  1. A device notifies CPU of interrupt request
  2. CPU completes execution of the current instruction
  3. Execution of main program is suspended
  4. Interrupts are disabled
  5. Some internal registers are saved (including program counter)
  6. Device may be acknowledged
  7. Interrupt service routine is selected
  8. Interrupt service routine is executed
  9. Registers are restored
  10. Interrupts are enabled
  11. Execution of main program resumes
17
Q

Why should interrupt service routines (ISR) execute as fast as possible?

A

Because they are interrupting other tasks

18
Q

Explain the structure of an interrupt service routine (ISR)

A
  1. Save any registers modified by the ISR
  2. Acknowledge the device
  3. Re-enable interrupts to allow higher or same priority interrupts (design specific)
  4. Test for a valid interrupt and / or determine the exact source of the interrupt
  5. Complete desired action
  6. Restore registers
  7. Return from interrupt
19
Q

What is the difference between vectored and non-vectored interrupts?

A

Vectored interrupts have a fixed priority associated with the interrupt vector. In non-vectored interrupts, the software must determine priority and which ISR goes with each interrupt.

20
Q

Explain the steps in interrupt initialization

A
  1. Disable all interrupts
  2. Enable device interface interrupts by setting appropriate device interface registers
  3. Set interrupt mask to allow interrupt from device
  4. Initialize interrupt vector with address of ISR
  5. Enable interrupts as required