{ "q08": { "type": "blank", "question": "\n\nRather than prevent deadlock, we can instead try to avoid it by having a\nsmart ____ that will consider the dependencies between threads or by having a\nservice that ____ deadlock and provides ____ techniques.\n\n\n" }, "q02": { "type": "multiple", "question": "\n\nRegarding using semaphores to implement locks and condition variables,\nwhich of the following statements are true (choose all that apply)?\n\n\n", "responses": { "cond_init": "To make a condition variable, we initialize the semaphore to 1.", "lock_call": "To make a lock (binary semaphore), we first sem_post, perform the critical section, and then sem_wait", "cond_call": "To make a condition variable, we use sem_post to signal and sem_wait to wait.", "lock_init": "To make a lock (binary semaphore), we initialize the semaphore to 1." } }, "q03": { "type": "multiple", "question": "\n\nRegarding reader-writer locks, which of the following statements are true\n(choose all that apply)?\n\n\n", "responses": { "starvation": "Reader-writer locks are prone to starvation problems.", "overhead": "Reader-writer locks generally improve performance over simple and fast locking primitives.", "writers": "Reader-writer locks suspend all readers once a writer requires access.", "concurrency": "Reader-writer locks allow for multiple concurrent readers as long as there are no writers." } }, "q01": { "type": "blank", "question": "\n\nA ____ is a synchronization primitive that consists of an ____ value that\nwe can manipulate with two routines:\n\n\n