1·short sem_op; (semaphore operation)
short sem_op; (信号量操作)
2·When all threads are waiting, the trace shows which threads are deadlocked and possibly waiting on the same semaphore.
当所有的线程都在等待,该跟踪会显示哪些线程是死锁的并可能在等待相同的信号量。
3·Finally, as we mentioned in the first article, not all semaphore timeout messages indicate a serious problem.
最后,正如第一篇文章中提到的,并非所有信号量超时消息都意味着严重的问题。
4·It is common for semaphore timeouts to occur on a busy server.
在忙碌的服务器上出现信号量超时是很常见的。
5·We recommend a better strategy: to remain aware of the data requirements from a program design viewpoint and have a semaphore protect smaller amounts of data.
我们推荐一种更好的战略:从程序设计的视角分析数据需求,让一个信号量保护的数据量更少。
1·Unsigned short sem_num; (semaphore number).
unsigned short sem_num;(信号量个数)。
2·This method is called to wait for an event completion on the indicated semaphore, with a specified time.
调用这个方法来等待所需要信号上某个事件的完成,等待指定的一段时间。
3·With a traditional concurrent environment, you might use a solution such as a semaphore that allows processes to determine whether a variable is 'in use' or can be updated.
在传统并行环境中,您可以使用信号量这样的解决方案,允许进程确定一个变量是否 “处于使用中”,还是可更新。
4·Then it atomically decreases the semaphore count.
然后它自动地减少信号的计数值。
5·Usually, the main use of a semaphore is to synchronize a thread?s action with other threads.
通常,信号的主要用途是同步某个线程与其他线程的动作。