14.9k views
3 votes
Explain why implementing synchronization primitives by disabling interrupts is not appropriate in a single-processor system if the synchronization primitives are to be used in user-level programs.

User Tkrajcar
by
4.4k points

2 Answers

2 votes

Answer: Explanation:

It is inappropriate to implement synchronization primitive in a single-processor if the synchronization primitives are to be used in user-level programs because it has the ability to disable interrupts. In addition, it can prevent context switching from taking place by disabling the power interrupt. This would now allow it to use the processor without letting other processes to execute. This can lead to starvation as resources are being allocated to other processes.

User Victor Elias
by
5.3k points
3 votes

Answer:

Implementing synchronization primitives by disabling interrupt is not appropriate because it reduces the flexibility of the system.

Synchronization primitives will make a program at user level to be able to switch interupts, thereby disabling the timer interrupt. Once a program at user-level has the ability to disable interrupts it also disables context switching which is not recommended for a program at that level.

Once the context switching is disabled, the program can now run on the processor without allowing other programs to execute, which is bad considering the fact that it is to be used in a single-processor system because single processor systems contain only one process, and only one program can run at a time.

User Hoof
by
4.7k points