Assume that a system has multiple processing cores. For each of thefollowing scenarios
Chapter 5, Problem 5.17(choose chapter or problem)
Assume that a system has multiple processing cores. For each of thefollowing scenarios, describe which is a better locking mechanismaspinlock or a mutex lock where waiting processes sleep while waitingfor the lock to become available: The lock is to be held for a short duration. The lock is to be held for a long duration. A thread may be put to sleep while holding the lock. #define MAX PROCESSES 255int number of processes = 0;/* the implementation of fork() calls this function */int allocate process() {int new pid;if (number of processes == MAX PROCESSES)return -1;else {/* allocate necessary process resources */++number of processes;return new pid;}}/* the implementation of exit() calls this function */void release process() {/* release process resources */--number of processes;}Figure 5.23 Allocating and releasing processes.
Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.
Becoming a subscriber
Or look for another answer