他忽略了信号量。
本系列的下一篇文章将阐述信号量。
第2部分处理的是信号量与事件。
以有组织的方式登记信号量代码。
Have an organized approach towards registering semaphore codes?
semid是信号量集的标识符。
避免使用单一信号量保护大量数据。
Avoid using a single semaphore that protects a large amount of data.
lpName是信号量的名称。
一个文本文件,显示被争用的信号量。
有名信号量可以在进程之间进行同步。
Named semaphores extend the synchronization between processes.
semflg是这个新信号量集的权限。
注意,信号量超时并不一定表示性能问题。
Note that semaphore timeouts do not always indicate a performance problem.
使用不同类型的信号量类
这会唤醒对这个信号量进行阻塞的所有线程。
在内核中可以使用互斥锁来实现信号量行为。
Mutexes are available in the kernel as a way to accomplish semaphore behavior.
在忙碌的服务器上出现信号量超时是很常见的。
It is common for semaphore timeouts to occur on a busy server.
nsems是这个信号量集中信号量的数量。
这被内核中一些依赖于架构的信号量函数使用。
This is used by some of the architecture-dependent semaphore functions in the kernel.
short sem_op; (信号量操作)
如果这个指针为空,那么这个信号量就不能被继承。
例如,现在通过资源控制处理所有共享内存和信号量。
For example, all Shared memory and semaphore Settings are now handled via resource controls.
“showstat”命令将报告信号量超时信息。
The 'show stat' command will record semaphore timeout information.
hSemaphore是一个指向信号量句柄的指针。
这个函数创建信号量,并返回这个信号量的句柄。
This function creates the semaphore and returns the handle to the semaphore.
这个方法允许您设置互斥信号量对象的相关属性。
在这个例子中,430d是信号量名称,58是超时的数量。
In this example, 430d is the semaphore name, and 58 is the number of timeouts.
系列的第2部分介绍了同步对象和原语,首先是信号量和事件。
Part 2 in the series covers synchronization objects and primitives, starting with semaphores and events.
这个函数会挂起调用线程,直到这个信号量有一个非空计数为止。
This function suspends the calling thread until the semaphore has a non-zero count.
其他资源(如信号量、网络句柄、数据库连接等)同样值得考虑。
Other resources, such as semaphores, network handles, database connections, and so on, deserve the same consideration.
真实的应用程序会使用信号量或其他技术控制对共享内存段的读写。
A real application would use semaphores or other techniques to control reading and writing to the Shared segment.
线程模块提供了许多同步原语,包括信号量、条件变量、事件和锁。
The threading module does provide many synchronization primatives, including semaphores, condition variables, events, and locks.
应用推荐