Subject / 929 questions

Programming MCQs

Page 19 of Programming multiple-choice questions with answers. Tap an option to check yourself.

Page 19 of 47

Question 362 Operating Systems

What is the main disadvantage of a spinlock?

Correct answer B. A waiting thread wastes CPU cycles by looping until the lock becomes free

Open question
Advertisement
Question 365 Operating Systems

How does a mutex lock differ from a binary semaphore?

Correct answer A. A mutex has an owner and should be released only by the thread that locked it, while a semaphore can be signalled by any thread

Open question
Advertisement
Question 370 Operating Systems

What does an atomic test-and-set instruction do?

Correct answer A. Returns the old value of a memory word and sets it to true as one indivisible operation

Open question
Advertisement