68 * of elements requires a traversal of the elements, and so may report
69 * inaccurate results if this collection is modified during traversal.
70 *
71 * <p>Bulk operations that add, remove, or examine multiple elements,
72 * such as {@link #addAll}, {@link #removeIf} or {@link #forEach},
73 * are <em>not</em> guaranteed to be performed atomically.
74 * For example, a {@code forEach} traversal concurrent with an {@code
75 * addAll} operation might observe only some of the added elements.
76 *
77 * <p>This class and its iterator implement all of the <em>optional</em>
78 * methods of the {@link Deque} and {@link Iterator} interfaces.
79 *
80 * <p>Memory consistency effects: As with other concurrent collections,
81 * actions in a thread prior to placing an object into a
82 * {@code ConcurrentLinkedDeque}
83 * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
84 * actions subsequent to the access or removal of that element from
85 * the {@code ConcurrentLinkedDeque} in another thread.
86 *
87 * <p>This class is a member of the
88 * <a href="{@docRoot}/java/util/package-summary.html#CollectionsFramework">
89 * Java Collections Framework</a>.
90 *
91 * @since 1.7
92 * @author Doug Lea
93 * @author Martin Buchholz
94 * @param <E> the type of elements held in this deque
95 */
96 public class ConcurrentLinkedDeque<E>
97 extends AbstractCollection<E>
98 implements Deque<E>, java.io.Serializable {
99
100 /*
101 * This is an implementation of a concurrent lock-free deque
102 * supporting interior removes but not interior insertions, as
103 * required to support the entire Deque interface.
104 *
105 * We extend the techniques developed for ConcurrentLinkedQueue and
106 * LinkedTransferQueue (see the internal docs for those classes).
107 * Understanding the ConcurrentLinkedQueue implementation is a
108 * prerequisite for understanding the implementation of this class.
|
68 * of elements requires a traversal of the elements, and so may report
69 * inaccurate results if this collection is modified during traversal.
70 *
71 * <p>Bulk operations that add, remove, or examine multiple elements,
72 * such as {@link #addAll}, {@link #removeIf} or {@link #forEach},
73 * are <em>not</em> guaranteed to be performed atomically.
74 * For example, a {@code forEach} traversal concurrent with an {@code
75 * addAll} operation might observe only some of the added elements.
76 *
77 * <p>This class and its iterator implement all of the <em>optional</em>
78 * methods of the {@link Deque} and {@link Iterator} interfaces.
79 *
80 * <p>Memory consistency effects: As with other concurrent collections,
81 * actions in a thread prior to placing an object into a
82 * {@code ConcurrentLinkedDeque}
83 * <a href="package-summary.html#MemoryVisibility"><i>happen-before</i></a>
84 * actions subsequent to the access or removal of that element from
85 * the {@code ConcurrentLinkedDeque} in another thread.
86 *
87 * <p>This class is a member of the
88 * <a href="{@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework">
89 * Java Collections Framework</a>.
90 *
91 * @since 1.7
92 * @author Doug Lea
93 * @author Martin Buchholz
94 * @param <E> the type of elements held in this deque
95 */
96 public class ConcurrentLinkedDeque<E>
97 extends AbstractCollection<E>
98 implements Deque<E>, java.io.Serializable {
99
100 /*
101 * This is an implementation of a concurrent lock-free deque
102 * supporting interior removes but not interior insertions, as
103 * required to support the entire Deque interface.
104 *
105 * We extend the techniques developed for ConcurrentLinkedQueue and
106 * LinkedTransferQueue (see the internal docs for those classes).
107 * Understanding the ConcurrentLinkedQueue implementation is a
108 * prerequisite for understanding the implementation of this class.
|