为了避免队列元素过多,你也可以为它设置一个最大值。
In order to keep the queue from growing too large, a Max capacity can be set.
在队列中加入一个元素的生产者会等待另一个线程的消费者。
The producer adding an element to the queue will wait for a consumer in another thread.
不是立即从队列中添加或者删除元素,线程执行操作阻塞,直到有空间或者元素可用。
Instead of adding and removing elements from the queue immediately, the thread performing the operation blocks until space or an element is available.
显示从队列中取出元素的两次调用之间的时间差。
The time delta is displayed between successive calls to get elements from the queue.
因为队列的大小没有界限,使得添加可以立即返回,但是在延迟时间过去之前,不能从队列中取出元素。
While the queue is unbound in size, enabling adds to return immediately, one cannot take an element from the queue until the delay time has expired.
在SQL中,处理队列上一个元素的传统方法是在第一步取这个元素。
The traditional way to process an element on a queue in SQL is to fetch the element in a first step.
这个改变引入一些索引,允许对大的重传队列中的元素进行随机访问,这个改变对于解决TCP协议栈的find - first攻击问题很重要。
A change that introduces some sort of index that allows access to random elements of the large retransmission queue is critical to address the find-first attacks against the TCP stack.
清单10. web . xml中指定JMS连接工厂和队列的元素。
Listing 10. Elements in web.xml specifying JMS connection factory and queue.
remove和poll方法都是从队列中删除第一个元素(head)。
The remove and poll methods are both for removing the first element (head) of the queue.
后两个方法element和peek用于在队列的头部查询元素。
The last two methods, element and peek , are for querying the element at the head of the queue.
可以用atom:control和atom:draft元素创建队列。
You can use atom: control and atom: draft elements to create a moderation queue.
PriorityBlockingQueue是具有无界限容量的队列,它利用所包含元素的Comparable排序顺序来以逻辑顺序维护元素。
PriorityBlockingQueue is a queue with an unbound capacity that maintains elements in their logical order through use of the Comparable sort order of the contained elements.
不仅能添加和删除元素,还能查看队列中有哪些元素。
Not only do you add and remove elements, you can also look at the queue to see what is there. Listing 5 shows the five methods of the queue interface.
不过在队列为空时,它就会从其它线程的队列中“窃取”一些元素。
However, if its queue is empty then it will steal items from another thread's queue.
当这个消费者出现时,这个元素就直接在消费者和生产者之间传递,永远不会加入到阻塞队列中。
When that consumer is available, the element is passed directly between consumer and producer, never literally getting added to the blocking queue.
用队列中的一个元素来表示其工作单位的任务。
A task whose unit of work is represented by an element in a queue.
将匹配元素的队列用新的一个队列来代替(函数数组)。
Replaces the queue of all matched element with this new queue (the array of functions).
将匹配元素的队列用新的一个队列来代替(函数数组)。
Replaces the queue of all matched element with this new queue (the array of functions).
应用推荐