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

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back