The mechanism used in Figure 13.13 to make scheduler code reentrant employs a single OS-provided lock for

Question:

The mechanism used in Figure 13.13 to make scheduler code reentrant employs a single OS-provided lock for all the scheduling data structures of the application. Among other things, this mechanism prevents threads on separate processors from performing P or V operations on unrelated semaphores, even when none of the operations needs to block. Can you devise another synchronization mechanism for scheduler-related operations that admits a higher degree of concurrency but that is still correct?

Figure 13.13

shared scheduler.Jock : low_levelJock shared ready Jist : queue of thread per-process private current.thread : thread procedure reschedule() -- assume that scheduler_lock is already held and that timer signals are disabled t: thread loop t:= dequeuelready_list) if t+ null exit -- else wait for a thread to become runnable release

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Programming Language Pragmatics

ISBN: 9780124104099

4th Edition

Authors: Michael L. Scott

Question Posted: