题目:
Which one(s) of the following statements adequately describe the test-and-set instruction for process synchronization?
(A) It does not work in multiprocessor environment.
(B) It can all be implemented in the user space, provided that the lock variable is in a shared memory region
(C) It does not waste any CPU cycles when a process cannot acquire a lock
(D) The CPU must guarantee that the test-and-set instruction is an atomic operation.
答案: (B)(D)
请问
A选项: 书上说在multiprocessor系统下用test-and-set效能差, 这个选项错是因为"只是效能差, 不代表不能用"吗?
B选项: 硬件的support, 不是要在kernel mode下才能运作吗? 还是我观念有误?