Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming.

Similar presentations


Presentation on theme: "CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming."— Presentation transcript:

1 CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming

2 CS533 - Concepts of Operating Systems 2 2 Questions  Why are threads “lightweight”?  Why block instead of spin waiting for a mutex?  If a mutex is a resource scheduling mechanism o What is the resource being scheduled? o What is the scheduling policy and where is it defined?  What is coarse-grain locking? o What effect does it have on program complexity? o What effect does it have on performance?

3 CS533 - Concepts of Operating Systems 3 3 Questions  What is “lock contention”? o Why is it worse on multiprocessors than uniprocessors? o What is the solution? … and its cost?  What else might cause performance to degrade when you use multiple threads?  Why is multithreaded programming hard?

4 CS533 - Concepts of Operating Systems 4 Which style is used in modern OSs?  Are modern operating systems (such as Linux) written in an event-based or multi-threaded style?  How does event-based programming relate to interrupt handling?  Where is the boundary between interrupt handling and thread execution? o How does this affect the approaches used for synchronization?

5 CS533 - Concepts of Operating Systems 5 Concurrent Computation vs Concurrent Blocking  How is the CPU scheduled: o In an event-based system? o In a thread-based system?  How is live state managed across blocking I/O calls: o In an event-based system? o In a thread-based system?

6 CS533 - Concepts of Operating Systems 6 Managing Highly Concurrent I/O  What is the problem with making thread allocation decisions statically? o What is the Slashdot effect?  Why is multi-threading not a good match for massive concurrency? o Is web service embarrassingly parallel? o What is the problem with the thread-per request model? o Why does the event handling model help?

7 CS533 - Concepts of Operating Systems 7 Questions  What is a thread pool?  Why do the following techniques help during heavy load? o Thread pool resizing o Event batching o Adaptive load shedding  Why does pipeline parallelism scale well? o Thread per stage vs thread per request  What does it mean for a service to be “well conditioned”?


Download ppt "CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming."

Similar presentations


Ads by Google