gpt4 book ai didi

java - 无界无等待?

转载 作者:行者123 更新时间:2023-12-03 20:00:48 28 4
gpt4 key购买 nike

这是ConcurrentLinkedQueue的文档说明:

An unbounded thread-safe queue based on linked nodes. This queue orders elements FIFO (first-in-first-out).
...
This implementation employs an efficient "wait-free" algorithm

是否有可能无限制 无等待
我很确定无等待确保有限制任何操作。

最佳答案

I am pretty sure wait-freedom ensures a bound on any operation.

操作所用的时间(或指令数,或其他)的界限。

在该 JavaDoc 中,“无界”可能指的是队列可能包含的元素数

例如,LinkedBlockingDeque 的 JavaDoc writes :

An optionally-bounded blocking deque based on linked nodes.

The optional capacity bound constructor argument serves as a way to prevent excessive expansion. The capacity, if unspecified, is equal to Integer.MAX_VALUE. Linked nodes are dynamically created upon each insertion unless this would bring the deque above capacity.

关于java - 无界无等待?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10131607/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com