Fill in the Appropriate YN and Why or Why not columns in the
Solution
Spinlock
Single Processor:
Approriate - N
Why - A spin lock on a single processor system will waste resources, slowing down the owner of the lock. It can also lead to a deadlock.
Multip-Processor:
Appropriate - Y
Why - A spinlock is prefferable on a multi-processor system since spinlocks are useful when another process can execute while one is spinning on the lock.
Disable interupts:
Single processor:
Appropriate - Y
Why - Disabling means that a process disables interrupts before entering the critical section and enables the interrupt immediately after exiting the critical section.
On a uniprocessor or single core processor, disabling interrupts disables interrupts for the entire system until the programmer re-enables interrupts.
Multi-Processor:
Appropriate - N
Why - In multi-processor system, each CPU/core execute code simultaneously, so whether the current CPU has disabled interrupts has nothing to do to avoid other CPU from entering the same region.
Blocking wait queue:
Single Processor:
Appropriate - Y
Why - Sometimes the system may have to wait on some I/O operations. This will work the same in single as well as multi processor systems.
Multi-Processor:
Appropriate - Y
Why - Sometimes the system may have to wait on some I/O operations. This will work the same in single as well as multi processor systems.
