The producer adding an element to the queue will wait for a consumer in another thread.
在队列中加入一个元素的生产者会等待另一个线程的消费者。
When the thread completes its running slice on the CPU, it gets put back on the queue.
当线程在CPU上的时间片结束之后,它将被重新放回到这个队列中。
Another common threading model is to have a single background thread and task queue for tasks of a certain type.
另一个常见的线程模型是为某一类型的任务分配一个后台线程与任务队列。
There would be a bit of work involved in deciding (and programming) exactly how an arbitrary jump would interact with a linear thread queue, but nothing particularly mysterious about the work.
决定(以及编写)一个任意的跳转究竟会如何与线性线程队列交互将涉及到不少工作,不过这些工作中没有什么特别神秘的地方。
If events are building up in this queue, but not in the queue in front of the collaboration thread pool, then increase the number of threads configured for the source adapter controller.
如果事件在此队列中堆积,但并没有在协作线程池前面的队列中堆积,则请增加为源适配器控制器配置的线程数量。
The first thread locks the mutex and appends data to the queue, while the other threads wait for their turn.
第一个线程锁住互斥并把数据添加到队列中,而其他线程等待轮到它们操作。
Each CPU on a system has its own dedicated run queue, which is a list of runnable threads sorted by thread priority value.
系统上的每个CPU都有自己专用的运行队列,该队列是按线程优先级值排序的可运行线程的列表。
Instead of throwing an exception when the queue is empty, the reader thread now blocks itself on the condition variable.
当队列是空的时候,读线程现在并不抛出异常,而是在条件变量上阻塞自身。
If events are building up in the transport queue (in front of the listener), increase the size of the thread pool for both the listener and the source adapter controller.
如果事件在传输队列(位于侦听器前)中堆积,则请同时增大侦听器和源适配器控制器的线程池的大小。
Normally each thread reads and writes to its own queue.
普通情况下,每个线程只对其自己的队列进行读写。
During idle time, the UI thread is also responsible for processing all messages in the application's Windows message queue.
在空闲时候,该UI线程同样要对应用程序的窗体消息队列中的所有消息进行负责。
A run queue is a list of runnable threads, sorted by thread priority value.
运行队列是由运行线程所组成的列表,按照线程优先级的值进行排序。
This automatically places the thread on the global run queue.
这样一来,就会自动地将线程放入到全局运行队列中。
When a lock is released, the system chooses the thread from the front of the highest-priority queue of contenders to try to lock the object.
释放锁以后,系统从争用者的最高优先级队列的前端选择线程,以便试图锁定对象。
When a CPU is ready to dispatch a thread, the global run queue is checked before any of the others.
当CPU准备分派线程时,它会先检查全局运行队列,然后再检查其他队列。
So far, if a reader thread wanted to read data from a queue that had no data, you just threw an exception and moved on.
目前,如果读线程试图从没有数据的队列读取数据,仅仅会抛出异常并继续执行。
In a bounded blocking queue, the writer thread also needs to wait if the queue is full.
对于有大小限制的阻塞队列,如果队列满了,写线程也需要等待。
A thread with an RT priority that voluntarily yields is placed at the back of the queue for its priority.
具有RT优先级并自愿让步的线程的优先级被置于队列的后端。
A thread pool worker thread pulls the next WWEC from the input queue and runs it.
线程池工作线程从输入队列提取下一个WWEC,并运行它。
The queue is then read by a thread pool, which acquires the measurement and completes the trace process.
然后,线程池读取该队列,获取测量数据并完成跟踪流程。
In a blocking queue, only the reader thread needs to wait when there is no data in the queue.
对于阻塞队列,只有读线程需要在队列中没有数据时等待。
The method is instead added to a compilation queue, and the thread is allowed to continue running and execute the non-compiled version of the method.
方法被添加到编译队列中,而线程可以继续运行并执行方法的非编译版本。
In the run method of this class, grab the Web page, chunk, from off of the queue in each thread, and then process this chunk with Beautiful Soup.
在这个类的run方法中,从队列中的各个线程获取web页面、文本块,然后使用BeautifulSoup处理这个文本块。
The thread will in fact attempt another remove call on the queue and will become blocked until the next available request.
事实上,线程会对队列尝试另一个remove调用,并变成阻塞,直到下一个请求可用。
In looking at the code, you can see that we added another instance of a queue, and then passed that queue into the first thread pool class, ThreadURL.
分析这段代码时您可以看到,我们添加了另一个队列实例,然后将该队列传递给第一个线程池类ThreadURL。
The first reader thread locked the mutex, realized that the queue is empty, and blocked itself on _cond, which implicitly released the mutex.
第一个读线程锁住互斥锁,发现队列是空的,然后在 _cond 上阻塞自身,这会隐式地释放互斥锁。
This next example instead returns the whole Web page that each thread grabs, and then places it into another queue.
而下一个示例则将返回各线程获取的完整web页面,然后将结果放置到另一个队列中。
Similarly, when a notify() is done, the thread from the front of the highest-priority queue of waiters is unblocked from its wait.
类似地,完成notify() 以后,等待者的最高优先级队列前端的线程从等待中解除阻塞。
The audit maximum incoming queue depth shows how many measurement objects were waiting on the queue to be processed by the audit thread at any one time.
审计最大传入队列深度显示了同一时刻有多少个measurement对象正在排队等候审计线程处理。
Any thread can tell which state the queue is in by comparing tail.next to null, which is the key to enabling threads to help other threads "finish" their operation.
任何线程通过比较tail . next是否为null,就可以判断出队列的状态,这是让线程可以帮助其他线程“完成”操作的关键。
应用推荐