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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinPool.java (file contents):
Revision 1.307 by dl, Tue Mar 15 15:56:30 2016 UTC vs.
Revision 1.308 by dl, Sat Mar 26 12:47:17 2016 UTC

# Line 671 | Line 671 | public class ForkJoinPool extends Abstra
671       * arrays sharing cache lines. The @Contended annotation alerts
672       * JVMs to try to keep instances apart.
673       */
674 <    // For now, using manual padding.
675 <    //    @jdk.internal.vm.annotation.Contended
676 <    //    @sun.misc.Contended
674 >    @jdk.internal.vm.annotation.Contended
675      static final class WorkQueue {
676  
677          /**
# Line 697 | Line 695 | public class ForkJoinPool extends Abstra
695          static final int MAXIMUM_QUEUE_CAPACITY = 1 << 26; // 64M
696  
697          // Instance fields
700        volatile long pad00, pad01, pad02, pad03, pad04, pad05, pad06, pad07;
701        volatile long pad08, pad09, pad0a, pad0b, pad0c, pad0d, pad0e, pad0f;
698          volatile int phase;        // versioned, negative: queued, 1: locked
699          int stackPred;             // pool stack (ctl) predecessor link
700          int nsteals;               // number of steals
# Line 709 | Line 705 | public class ForkJoinPool extends Abstra
705          ForkJoinTask<?>[] array;   // the elements (initially unallocated)
706          final ForkJoinPool pool;   // the containing pool (may be null)
707          final ForkJoinWorkerThread owner; // owning thread or null if shared
712        volatile Object pad10, pad11, pad12, pad13, pad14, pad15, pad16, pad17;
713        volatile Object pad18, pad19, pad1a, pad1b, pad1c, pad1d, pad1e, pad1f;
708  
709          WorkQueue(ForkJoinPool pool, ForkJoinWorkerThread owner) {
710              this.pool = pool;
# Line 1269 | Line 1263 | public class ForkJoinPool extends Abstra
1263  
1264      // Instance fields
1265  
1272    // Segregate ctl field, For now using padding vs @Contended
1273    //    @jdk.internal.vm.annotation.Contended("fjpctl")
1274    //    @sun.misc.Contended("fjpctl")
1275    volatile long pad00, pad01, pad02, pad03, pad04, pad05, pad06, pad07;
1276    volatile long pad08, pad09, pad0a, pad0b, pad0c, pad0d, pad0e, pad0f;
1277    volatile long ctl;                   // main pool control
1278    volatile long pad10, pad11, pad12, pad13, pad14, pad15, pad16, pad17;
1279    volatile long pad18, pad19, pad1a, pad1b, pad1c, pad1d, pad1e;
1280
1266      volatile long stealCount;            // collects worker nsteals
1267      final long keepAlive;                // milliseconds before dropping if idle
1268      int indexSeed;                       // next worker index
# Line 1289 | Line 1274 | public class ForkJoinPool extends Abstra
1274      final UncaughtExceptionHandler ueh;  // per-worker UEH
1275      final Predicate<? super ForkJoinPool> saturate;
1276  
1277 +    @jdk.internal.vm.annotation.Contended("fjpctl") // segregate
1278 +    volatile long ctl;                   // main pool control
1279 +    
1280      // Creating, registering and deregistering workers
1281  
1282      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines