Redian新闻
>
请教 填写签证表格,创建帐户的时候,为什么总是不能成功
avatar
请教 填写签证表格,创建帐户的时候,为什么总是不能成功# Reunion - 探亲与陪读
r*o
1
一直觉得很奇怪,semaphore不是进程间的同步机制吗?
为啥老见人说semaphore是进程间的通信机制呢? 光靠semaphore能实现连个进程间的通
信吗?
avatar
x*a
2
总是出现这句话 Unable to validate captcha. Please try again.
什么原因啊
avatar
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.
avatar
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.

avatar
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.

【在 c****a 的大作中提到】
: 你的i/o example里面 为什么不能用mutex?
:
: mutex

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。