摘要:
表示之前对semaphore信号量木有神码概念。比较纳闷这玩意要干嘛,好吧继续stackflow:Mutex can be released only by thread that had acquired it, while you can signal semaphore from any other thread (or process), so semaphores are more suitable for some synchronization problems like producer-consumer.意思就是会所semaphore可以被任何线程或者进程释放,在生产者和消费 阅读全文
posted @ 2013-09-06 15:48
hailong
阅读(1043)
评论(0)
推荐(0)
摘要:
之前只是用过 关键段来对同进程不同线程进行互斥,防止对同一份资源或代码段的竞争;mutex可以理解为不同进程或者同一进程内防止对同一份资源的竞争;event更多的是同步,当然也是不同进程或者同一进程,用于事件的同步,要先做A再做B,这时候就可以用Event来通知;嗯,我立即的可能还是有问题的,还是收录些大牛的评论吧:You use a mutex to ensure that only one thread of execution can be accessing something. For example, if you want to update a list that can po 阅读全文
posted @ 2013-09-06 15:34
hailong
阅读(1819)
评论(0)
推荐(0)

浙公网安备 33010602011771号