Docsity

Defer Work-Advance Operating System-Lecture Slides, Slides of Advanced Operating Systems

Partial preview of the text

Download Defer Work-Advance Operating System-Lecture Slides and more Slides Advanced Operating Systems in PDF only on Docsity!

Lecture No.

Overview of today’s lecture

 Thread usage paradigms

 Paper by Hauser et al.

 Pros and Cons of different paradigms

Paradigms of thread usage (from Hauser et

al paper)

 Defer work

 General pumps

 Slack processes

 Sleepers

 One-shots

 Deadlock avoidance  Rejuvenation  Serializers  Encapsulated fork  Exploiting parallelism

Defer work

 A very common scenario for thread usage

 Client may see unexpected response…

something client requested is fired off to happen in the background  Forking off examples  a document print operation  Updating a window  Sending an email message  Issue? What if thread hangs for some reason. Client may see confusing behavior on a subsequent request!

Sleepers, one-shots

 These are threads that wait for some event,

then trigger, then wait again

 Examples:

 Call this procedure every 20ms, or after some timeout  Can think of device interrupt handler as a kind of sleeper thread

Deadlock avoiders

 Thread created to perform some action that

might have blocked, launched by a caller who

holds a lock and doesn’t want to wait

Task rejuvenation

 A nasty style of thread

 Application had multiple major subactivities, such as input handler, renderer.  Something awful happened.  So create a new instance and pray

Others

 Serializers: a queue, and a thread that removes work from it and processes that work item by item  for (;;) { get_next_event(); handle_event(); }

 Concurrency exploiters: for multiple CPUs

 Encapsulated forks: Hidden threads used in library packages