Too Much Synchronization?Deadlock b 9 C9臣90999 Thread A: Thread B: semaphore1.lock(); semaphore2.lock(); semaphore2.lock(); semaphore1.lock(); /use data guarded by /use data guarded by semaphores * semaphores * semaphore1.unlock(); semaphore1.unlock(); semaphore2.unlock(); semaphore2.unlock(); (Image:RPI CSCI.4210 Operating Systems notes)
Too Much Synchronization? Deadlock Thread A: semaphore1.lock(); semaphore2.lock(); /* use data guarded by semaphores */ semaphore1.unlock(); semaphore2.unlock(); Thread B: semaphore2.lock(); semaphore1.lock(); /* use data guarded by semaphores */ semaphore1.unlock(); semaphore2.unlock(); (Image: RPI CSCI.4210 Operating Systems notes)
And if you thought I was joking
And if you thought I was joking…
The Moral:Be Careful! Synchronization is hard Need to consider all possible shared state a Must keep locks organized and use them consistently and correctly o k Knowing there are bugs may be tricky;fixing them can be even worse! Keeping shared state to a minimum reduces total system complexity
The Moral: Be Careful! ◼ Synchronization is hard ◼ Need to consider all possible shared state ◼ Must keep locks organized and use them consistently and correctly ◼ Knowing there are bugs may be tricky; fixing them can be even worse! ◼ Keeping shared state to a minimum reduces total system complexity
NC&IS Introduction to Distributed System Fundamentals of Networking
Introduction to Distributed System Fundamentals of Networking
TCP ROUTER IP FTP UDP FLV Ploger -internet.fl 士网 HTTP Gateway Protocol W四 合nfo07:2771251 settings >Ployng infemet flu SOCKET PORT SWITCH Firewall
TCP UDP ROUTER IP SWITCH HTTP FTP SOCKET PORT Protocol Firewall Gateway