148k views
4 votes
What is the best kernel synchronization solution on multicore systems when a lock is held for brief periods ?

a) mutex with thread suspension
b) disabling interrupts
c) spinlock with test and set
d) busy waiting for condition

1 Answer

0 votes

Answer: C) spin-lock with test and set

Step-by-step explanation:

In spinlock, when a thread locks a spinlock then it continuously retrying locking until it succeeds. Spinlock is the lock that cause thread and continuously check that whether the lock are available or not for synchronization.

So that is why spinlock is best synchronization solution as it is not allowing any another thread.

On the other hand, in mutex thread try to lock a mutex and then, it automatically go to sleep mode before locking and immediate allow another thread to run.

User Rystsov
by
5.6k points