1 / 8

CS533 Concepts of Operating Systems Class 2

CS533 Concepts of Operating Systems Class 2. The Duality of Threads and Events. 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?

beardsley
Download Presentation

CS533 Concepts of Operating Systems Class 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS533 Concepts of Operating SystemsClass 2 The Duality of Threads and Events

  2. 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? • How does this affect the approaches used for synchronization? CS533 - Concepts of Operating Systems

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

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

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

  6. Duality • What really happens underneath the abstraction? • For synchronous procedure calling and message passing • For asynchronous procedure calling and message passing • Fundamental tasks: • execute new instruction stream • exchange data • What is the costs of pushing state onto the stack and popping it off, vs the cost of allocating copying then freeing message memory? CS533 - Concepts of Operating Systems

  7. Optimizations Discussed in Future Classes • How could you optimize context switch costs for local message passing? • How could you optimize data movement costs for local message passing? • What conventions would you need to follow to avoid needing synchronization? • How does this approach compare to local state management in procedure calling? • How might you further optimize pointer passing? • … and what does this remind you of? Hint: SP. CS533 - Concepts of Operating Systems

  8. Duality • Is threading just an automated “pattern” of context switch and data exchange that is done manually in event models? • Do the two models have equal memory consumption? • Is over-allocation of memory inevitable in thread-based systems? • If not, how can you avoid it … and at what cost? CS533 - Concepts of Operating Systems

More Related