要等待某个事件,则可以使用 semop()函数,并将 sem_op 的值设置为-1,这样就可以阻塞调用进程,直到它变为有信号状态为止。
To wait on an event, semop() function is used with sem_op value as -1 thus blocking the calling process until it is signaled.
阻塞进程的最后计数将从这个调用中输出。
The final count of blocking processes is output from this call.
有时你还不得不选择一个专门的进程来等待阻塞调用来结束这些,你的其它代码也随之结束。
Sometimes, you have no choice but to delegate a victim thread to wait for a blocking call to finish, while the rest of your code gets on with its life.
服务上调用的进程密集型方法不应该阻塞整个进程。
Process-intensive methods invoked on a service should not block the entire process.
如果进程调用一个实现ChannelOut put接口的对象的这个方法,进程也会阻塞,直到通道接受对象。
A process that calls this method on an object implementing the ChannelOutput interface will block until the object is accepted by the channel.
如果进程调用一个实现ChannelInput接口的对象的这个方法,那么进程会阻塞,直到在通道另一端的进程实际向通道写入了一个对象。
A process that calls this method on an object implementing the ChannelInput interface will block until an object is actually written on the channel by a process at the other end of the channel.
在计数增加之后,调用进程执行wait,这导致调用进程受阻塞。
After the counter has been incremented, the invoking process does a wait , which leads to the calling thread getting blocked.
通常,当一个进程进行系统调用不能立即完成时,为了保证处理器的高利用率,这个进程就会被阻塞,其他的进程会被调度执行。
Normally, when a process makes a system call that cannot be completed immediately, the process blocks and another process is scheduled in order to make full use of the processor.
通常,当一个进程进行系统调用不能立即完成时,为了保证处理器的高利用率,这个进程就会被阻塞,其他的进程会被调度执行。
Normally, when a process makes a system call that cannot be completed immediately, the process blocks and another process is scheduled in order to make full use of the processor.
应用推荐