To access shared memory using a semaphore synchronization primitive, select what a process will do under the following conditions:
Group of answer choices
1. Check the semaphore, if semaphore > 0, the process _______________.
[ Choose ] can use the resource; then semaphore-=1 semaphore+=1 goes to sleep until it becomes < 0 then wakes up and returns to 1. goes to sleep until it becomes > 0 then wakes up and returns to 1.
2. If semaphore==0, the process _________________.
[ Choose ] can use the resource; then semaphore-=1 semaphore+=1 goes to sleep until it becomes < 0 then wakes up and returns to 1. goes to sleep until it becomes > 0 then wakes up and returns to 1.
3. If a process is done with the resource __________________.
[ Choose ] can use the resource; then semaphore-=1 semaphore+=1 goes to sleep until it becomes < 0 then wakes up and returns to 1. goes to sleep until it becomes > 0 then wakes up and returns to 1.