P2L4: Thread Design Considerations Flashcards

1
Q

What’s a signal? What’s an interrupt?

A

Interrump

  • events generated externally by components other than the CPU
  • determined on physical platform
  • async

Signals

  • events triggered by CPU and sofware running on it
  • determined on OS
  • async or sync

Similar

  • Can be disabled/suspended via a mask, CPU mask for interr, process mask for signal
  • If enabled will trigger correspondin handler
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens during interrupt or signal handling? How does the OS know what to execute in response to a interrupt or signal? Can each process configure their own signal handler? Can each thread have their own signal handler?

A

.

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

Visual metaphor for interrupt and signal

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

What happens during interrupt handling?

A

.

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

What happens during signal handling?

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

How does the OS know what to execute in response to a interrupt or signal?

A
  • The signal or interrupt includes a code. The code is looked up in a singal/interrupt handler table with the startting address of the routine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are interrupst or singal masks?

A

They are bits that say if handler disabled or not

problem

  • handlers sometimes can be problematic if they use mutex and can cause a deadlock
  • Sometimes it is required that critical sections are not interrupted.

Solution

  • Use masks to disable handlers when we do not want mutex in handlers. If a signal type is blocked, and signals of this type are received, they are suspended until process termination or until the signal type is unblocked
    http: //www.cs.um.edu.mt/~jcor1/SystemsProgramming/CourseMaterials/9_AdvancedSignalOperations.pdf
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If the kernel cannot see user-level signal masks, then how is a signal delivered to a user-level thread (where the signal can be handled)?d

A
  • User level mask for process in user, only visible to kernel
  • Kernel level mask for process, only visible to kernel
  • Signal occurs and what should the kernel do. It is possible that mark in kernel is 1 and that the signal is activated.
  • One option is that the user level thread makes a system call
  • The thread lib gets the signal and decides what to do, if there is another thread with mask 1 to handle it
    https: //gatech.instructure.com/courses/190814/pages/28-threads-and-signal-handling?module_item_id=1667452
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The Sprite caching paper motivates its design based on empirical data about how users access and share files. Do you understand how the empirical data translated in specific design decisions? Do you understand what type of data structures were needed at the servers’ and at the clients’ side to support the operation of the Sprite system (i.e., what kind of information did they need to keep track of, what kids of fields did they need to include for their per-file/per-client/per-server data structures).

A

.

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

What are some of the design options in implementing a distributed service?

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

What are the tradeoffs associated with a stateless vs. stateful design?

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

What are the tradeoffs (benefits and costs) associated with using techniques such as caching, replication, partitioning, in the implementation of a distributed service (think distributed file service).

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