What are asynchronous, deferred, and disabled cancellation in pitheads? What makes them different? 2. What is the role of the contentiousness for pitheads? How does it affect the execution of pitheads? 3. Assume you have a system that does not provide a sleep(unsigned long uses) call to suspend the execution of the thread for a given amount of time, say in execs.
How would you implement this function using condition variables? (Describe your implementation in form of a C/C++ code snippet similar to the textbook. ) 4. (Research Assignment) The expect system call (and variations of it) transforms the calling process into a new process by loading the given executable Into memory. (a) What happens to the file descriptors of open files? (b) How can this behavior be controlled? 5. [3] Ten processes share a critical section Implemented by using a semaphore x.
Nine of these processes use the code P(x);
Design a class In Java (called Coffeecakes, to be Initialized with a given value for n) with two methods, credit and debit, that Implements this type of account.