在使用之前,Barrier需要知道有多少线程将会使用它。
Before it is used, the Barrier needs to know how many threads will be using it.
所以,代码是否有问题取决于有多少线程能够并发地访问这个操作。
So, whether the code is buggy depends on how many threads can access the operation concurrently.
一般而言,配置MPM包括告知apache怎样去控制有多少worker正在运行,它们是线程还是进程。
In general, configuring an MPM involves telling Apache how to control how many workers are running, whether they're threads or processes.
对于这个示例,有更多的代码需要说明,但与第一个线程示例相比,它并没有复杂多少,这正是因为使用了队列模块。
This example has a bit more code to explain, but it isn't that much more complicated than the first threading example, thanks to the use of the queuing module.
除非可以严格控制在任何给定时间有多少活动线程,否则,即使是最高优先级线程用于执行操作的时间也可能出现相对较大的差异。
Unless you can strictly control how many threads are active at any given time, the time it takes even your highest-priority threads to execute an operation may fall within a relatively large range.
除非可以严格控制在任何给定时间有多少活动线程,否则,即使是最高优先级线程用于执行操作的时间也可能出现相对较大的差异。
Unless you can strictly control how many threads are active at any given time, the time it takes even your highest-priority threads to execute an operation may fall within a relatively large range.
应用推荐