P2L4: Thread Design Considerations Flashcards
What’s a signal? What’s an interrupt?
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
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?
.
Visual metaphor for interrupt and signal
What happens during interrupt handling?
.
What happens during signal handling?
How does the OS know what to execute in response to a interrupt or signal?
- 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
What are interrupst or singal masks?
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
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
- 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
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).
.
What are some of the design options in implementing a distributed service?
What are the tradeoffs associated with a stateless vs. stateful design?
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).