Content area
Full Text
In a classic scenario of priority inversion, a binary semaphore is named 'PRNT' to symbolize that it is being used to regulate the access of tasks to a printer. It is initialized with a count of one or one "token" to indicate that initially, one printer is available.
Tasks in this scenario are designed with disciplined access to the printer: Whenever a task wishes to print, it must first obtain the count (token) from the semaphore. If no token is available, the task will be blocked from running. When the task later finishes printing, it must return the token to the semaphore.
The scenario begins with low-priority Task A...