总是出现这句话 Unable to validate captcha. Please try again. 什么原因啊
l*y
3 楼
mutex是专门用来同步的, semaphonre既可以用来同步也可以用来通信。因为mutex只 能由拥有mutex的那个进程释放,而semaphonre可以由非拥有的进程释放。这也是mutex 和 binary semaphonre的一个主要区别吧。 Consider I/O examples, we pick up a binary semaphore to wait for some kind of I/O, when the I/O comes, task picks up the byte, the task then releases the same semaphore. This cannot be done with a mutex.
c*a
4 楼
你的i/o example里面 为什么不能用mutex?
mutex
【在 l*******y 的大作中提到】 : mutex是专门用来同步的, semaphonre既可以用来同步也可以用来通信。因为mutex只 : 能由拥有mutex的那个进程释放,而semaphonre可以由非拥有的进程释放。这也是mutex : 和 binary semaphonre的一个主要区别吧。 : Consider I/O examples, we pick up a binary semaphore to wait for some kind : of I/O, when the I/O comes, task picks up the byte, the task then releases : the same semaphore. This cannot be done with a mutex.
l*y
5 楼
thread1 waits for the I/O to complete, thread2 is responsible for completing the I/O operation. thread1 get the semaphonre first, thread2 realse it then . Then thread1 find the I/O operation completes and can do the following things. This is a kind of communication. If use mutex, if thread1 get the mutex, only thread1 can release the mutex.