ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/LinkedTransferQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/LinkedTransferQueue.java (file contents):
Revision 1.23 by jsr166, Wed Sep 1 21:43:08 2010 UTC vs.
Revision 1.24 by jsr166, Wed Sep 1 21:55:34 2010 UTC

# Line 342 | Line 342 | public class LinkedTransferQueue<E> exte
342       * When these cases arise, rather than always retraversing the
343       * entire list to find an actual predecessor to unlink (which
344       * won't help for case (1) anyway), we record a conservative
345 <     * estimate of possible unsplice failures (in "sweepVotes").  We
346 <     * trigger a full sweep when the estimate exceeds a threshold
347 <     * indicating the maximum number of estimated removal failures to
348 <     * tolerate before sweeping through, unlinking cancelled nodes
349 <     * that were not unlinked upon initial removal. We perform sweeps
350 <     * by the thread hitting threshold (rather than background threads
351 <     * or by spreading work to other threads) because in the main
352 <     * contexts in which removal occurs, the caller is already
353 <     * timed-out, cancelled, or performing a potentially O(n)
354 <     * operation (i.e., remove(x)), none of which are time-critical
355 <     * enough to warrant the overhead that alternatives would impose
356 <     * on other threads.
345 >     * estimate of possible unsplice failures (in "sweepVotes").
346 >     * We trigger a full sweep when the estimate exceeds a threshold
347 >     * ("SWEEP_THRESHOLD") indicating the maximum number of estimated
348 >     * removal failures to tolerate before sweeping through, unlinking
349 >     * cancelled nodes that were not unlinked upon initial removal.
350 >     * We perform sweeps by the thread hitting threshold (rather than
351 >     * background threads or by spreading work to other threads)
352 >     * because in the main contexts in which removal occurs, the
353 >     * caller is already timed-out, cancelled, or performing a
354 >     * potentially O(n) operation (e.g. remove(x)), none of which are
355 >     * time-critical enough to warrant the overhead that alternatives
356 >     * would impose on other threads.
357       *
358       * Because the sweepVotes estimate is conservative, and because
359       * nodes become unlinked "naturally" as they fall off the head of

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines