follow link Assume that thread B releases its lock. It acquires the Lock's spinlock, which is free, and there is at least one thread in the waiting queue, namely A.
Suppose that A is chosen as next, so we call scheduler. But now inside makeReady there's a call to acquire the scheduler's spinlock, which wasn't released, because we performed a context switch before schedulerSpinlock. So how can thread A release the scheduler's spinlock now, if we cannot run it again?
If we assume every thread which is not running became not running because of calling suspend, then the freshly woken thread will release the scheduler spinlock that was acquired by the one that suspended itself.
Then it is sufficient to ensure that the scenario you envisioned will not happen -- schedulerSpinLock will be released by C either because C is exiting suspend, or some other function which repeats the pattern of suspend. The goodness of this design may be debatable. Whether you should release a spinlock in one thread that was allocated in another is probably a topic of hot debate in some circles.
Learn more. First 10 Free.
More information about this seller Contact this seller. Book Description Recursive Books, New Book. Shipped from UK.
Established seller since Seller Inventory LQ Seller Inventory M Delivered from our UK warehouse in 4 to 14 business days. Book Description Condition: New. Seller Inventory n.
Never used! This item is printed on demand.
Seller Inventory Book Description Recursive Books. Seller Inventory NEW Seller Inventory ING Items related to Operating Systems: Principles and Practice. Operating Systems: Principles and Practice.
Thomas Anderson ; Michael Dahlin. Principles and Practice.
Second Edition. Thomas Anderson.
University of Washington. Michael Dahlin.
University of Texas at Austin and. Thomas Anderson and Michael Dahlin. Recursive Books Ltd. To make the sharing of a computer tolerable, an operating system must. Over the past two.