。。Google了一下,楼主这个好像叫做Thundering herd
The thundering herd problem occurs when a large number of processes waiting for an event are awoken when that event occurs, but only one process is able to proceed at a time. After the processes wake up, they all demand the resource and a decision must be made as to which process can continue. After the decision is made, the remaining processes are put back to sleep, only to all wake up again to request access to the resource.根据这个来看,貌似会引起

解决方案 »

  1.   

    既然是Single Object就应该只有一个线程wait
      

  2.   

    是不是说,一个事件让多个等待者触发?那要看event的设定,如果是Manual Reset的,就可以让多个等待者触发。如果是自动的,就只能触发一个。
      

  3.   


    谬矣,单个对象是说被等待的是单个对象,但是n个线程同时等待同一个对象是可能的,有时候也是有必要的。如果是Mutex,多个线程同时等待的话,一旦所有者释放,那么只有一个等待的线程会被激活。
    自动重置的Event同理。
    手动重置的Event则不同,有多少等待的线程就会有多少线程被激活。
    信号量的等待看信号的个数,每个信号可以激活一个线程。
    其他如进程、线程的句柄也是可等待的,一旦结束,则有信号,有多少等待的线程就会有多少线程被激活。