Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a review on the following synchronization primitives and implementations:

ID: 3600577 • Letter: W

Question

Write a review on the following synchronization primitives and implementations: busy-waiting, block-wake up, disabling/enabling interrupts, spinlocks, mutex locks, semaphores, condition variables. In addition answer the following questions:
1) Which implementation of the three (busy-wait, block-wake up, dis/en intrps) to use when we have a single-core system vs. multicore?
2) Which implementation of the three to use based on how long we are occupying the CPU every time?
3) Which of the synchronization primitives above are more general? Are there specific types of problems that only one of the primitives can solve or can solve better than the rest? If so, what sort of problems?

Explanation / Answer

Here is my answer :

Busy-waiting: Busy waiting is a technique in which a process checks repeatedly if a condition is true .example: such as internet connection is available or not ,the process will checks it.

disabling/enabling interrupts: Through disabling /enabling interrupts we can easily access to shared resource .These are usually CPU related functions.

spinlocks: A spinlock is a lock which causes a thread while checking repeatedly if lock is available,It will help till it will explicitly released.

mutex locks: In a environment where there are many thread of execution mutex provides a mechanism for enforcing the limits to access the resources. semaphore is a type of lock.

semaphores: semaphore is a variable that is used to achieve synchronization in the multi processing environment and it is also used to solve critical section problem. 2 types of semaphores are listed:

1.counting semaphore

2.binary semaphore

condition variables : condition variables are user mode objects or synchronization primitives . It enables a thread to release a lock and goes to sleep state.It is used with critical section.

1. busy wait is used when we have single core system while dis/en intrps is used for multicore.

2.disabling/enabling is used .

3. Busy -wait primitives are more general type.yes ,such as critical section problems as well as consumer related problem can sove in a better way.

Thank You .

Have a good day :) :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote