Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS533 - Concepts of Operating Systems 1 Class Discussion.

Similar presentations


Presentation on theme: "CS533 - Concepts of Operating Systems 1 Class Discussion."— Presentation transcript:

1 CS533 - Concepts of Operating Systems 1 Class Discussion

2 CS533 - Concepts of Operating Systems 2 Questions Naive reader preference lock: o How do readers spin? what instruction is used on what location? why is this expensive? o How do writers spin? what instruction is used on what location? why is this expensive? o Why can't end_write simply clear the lock? o How might writers be starved?

3 CS533 - Concepts of Operating Systems 3 Questions Naive fair lock: o What is the key idea that enables fairness? o Why is it "naive“ how do readers and writers spin?

4 CS533 - Concepts of Operating Systems 4 Questions Algorithm 1: o What prevents a race between two potential acquirers in acquire_lock? o What location do threads spin on when contending for a lock? o How is I->locked updated to allow a spinning thread to proceed? Are subsequent accesses local? o Why might a thread have to spin in release_lock? o What stops the lock holder spinning indefinitely in release_lock, o Why does release_lock without CAS sacrifice FIFO ordering?

5 CS533 - Concepts of Operating Systems 5 Questions Smarter locks: o How is algorithm 1 extended to support readers and writers? o Why do threads need to read/update their predecessor rather than just successor? o Are these algorithms race-free? o Are they correct?

6 CS533 - Concepts of Operating Systems 6 Questions  What if the required atomic instructions are not available? o What is the problem with implementing them via kernel calls?  How can processors access private memory without using the interconnect/bus?  How realistic is a 3:1 read:write ratio?  How expensive is reading vs writing? o how should you favor performance of one over the other?  How would you expect the performance to change with changing costs of underlying primitives?


Download ppt "CS533 - Concepts of Operating Systems 1 Class Discussion."

Similar presentations


Ads by Google