70 likes | 258 Views
CS533 Concepts of Operating Systems Class 6. The Duality of Threads and Events. Questions. How does Knot address context switch overhead? What implications does this have for preemption? Are synchronization primitives needed in Knot? Are they needed in event-based systems?
E N D
CS533 Concepts of Operating SystemsClass 6 The Duality of Threads and Events
Questions • How does Knot address context switch overhead? • What implications does this have for preemption? • Are synchronization primitives needed in Knot? • Are they needed in event-based systems? • How much do they cost? • Why does Knot need asynchronous I/O calls? • How are they used? • How is I/O return handled? … and what does this remind you off? CS533 - Concepts of Operating Systems
Questions • Are event-based and multi-threaded programming really duals of each other? • How does message communication map to procedure call/return? • Synchronous message passing • Asynchronous message passing • Are they the same underneath? • How would you implement message passing? • How would you implement procedure calling? • Fundamental tasks: • execute new instruction stream • exchange data CS533 - Concepts of Operating Systems
Questions • What is the costs of pushing state onto the stack and popping it off, vs the cost of allocating copying then freeing message memory? • How would you optimize context switch costs for local message passing? • How would you optimize data movement costs for local message passing? • What conventions would you need to follow to avoid needing synchronization? • How does this compare to local state management in procedure calling? • How might you optimize pointer passing? • What does this remind you of? CS533 - Concepts of Operating Systems
Questions • 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? • Did it matter before, and does it today? • 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
Questions • Do both models present the same scheduling choices? • Do they have the same locality of reference behavior? • Does this matter? • Can you do “batching” in both models? • Are both models equivalent with respect to dynamic allocation of hardware resources (CPUs)? • Are both models equivalent with respect to maintaining processor affinity? • Is it better to maintain good code locality or good data locality? CS533 - Concepts of Operating Systems
Reminder • Class 7 presenters • Discuss your presentation plans with me ahead of time • Mail me the final version of your slides BEFORE the class CS533 - Concepts of Operating Systems