Question

what is a problem with using a spin lock instead of a mutex? a. small critical...

what is a problem with using a spin lock instead of a mutex?

a. small critical sections that are executed repeatedly by the same thread, can cause problems in the CPU itself due to centrifugal force

b. if the critical section is large, CPU time can be wasted when two threads try to execute the critical section at the same time

c. spin locks are always better than mutexes if you don’t need condition variables

d. spin locks are not susceptible to starvation
0 0
Add a comment Improve this question Transcribed image text
Answer #1

what is a problem with using a spin lock instead of a mutex ?

b. if the critical section is large, CPU time can be wasted when two threads try to execute the critical section at the same time

when two threads try to execute the critical section at the same time ,then one thread holds the locks and other thread goes for sleep, immediately allowing another thread to run Putting threads to sleep and waking them up again are time consuming operations, taking more CPU time.

Add a comment
Know the answer?
Add Answer to:
what is a problem with using a spin lock instead of a mutex? a. small critical...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT