/
withdraw (account, amount) {    wait(S);    balance = get_balance(acco withdraw (account, amount) {    wait(S);    balance = get_balance(acco

withdraw (account, amount) { wait(S); balance = get_balance(acco - PDF document

giovanna-bartolotta
giovanna-bartolotta . @giovanna-bartolotta
Follow
417 views
Uploaded On 2016-07-30

withdraw (account, amount) { wait(S); balance = get_balance(acco - PPT Presentation

It is undefined whichthread runs after a How can it sleep with interrupts disabledNeed to be able to reference current threadwait S Disable interrupts while Svalue 0 Enable interrupts ID: 425595

undefined whichthread runs

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "withdraw (account, amount) { wait(S);..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

withdraw (account, amount) { wait(S); balance = get_balance(account); balance = balance Ð amount; put_balance(account, balance); signal(S); return bala It is undefined whichthread runs after a How can it sleep with interrupts disabled?!Need to be able to reference current threadwait (S) { Disable interrupts; while (S-�value == 0) Enable interrupts;} mutex Ð control access to readcount!Semaphore w_or_r Ð exclusive writing or reading ac one thread can call Join on another!A thread cannot call Join on itself!A thread should be able to call Join on a thread that hasa