@Documented @Inherited @Target(value={TYPE,FIELD,METHOD}) @Retention(value=RUNTIME) public @interface Parallelizable
Indicates that a class, a method or a field can be used by multiple
threads concurrently and whether or not it is
mutex-free
(not blocking).
public class Operators { @Parallelizable public static final Reducer<Object> ANY = new Reducer<Object>() { ... } @Parallelizable(mutexFree = false, comment="Internal use of synchronization") public static final Reducer<Object> MAX = new Reducer<Object>() { ... } @Parallelizable(mutexFree = false, comment="Internal use of synchronization") public static final Reducer<Object> MIN = new Reducer<Object>() { ... } @Parallelizable public static final Reducer<Boolean> AND = new Reducer<Boolean>() { ... } @Parallelizable public static final Reducer<Boolean> OR = new Reducer<Boolean>() { ... } @Parallelizable(comment="Internal use of AtomicInteger") public static final Reducer<Integer> SUM = new Reducer<Integer>() { ... } }
Classes with no internal fields or Immutable
are usually parallelizable and mutex-free.
Modifier and Type | Optional Element and Description |
---|---|
String |
comment
Provides additional information (default
"" ). |
boolean |
mutexFree
Indicates if this element does not use any form of mutex to
access shared resources (default
true ). |
boolean |
value
Indicates if this element can safely be used concurrently
(default
true ). |
public abstract boolean value
true
).public abstract boolean mutexFree
true
). To avoid
priority inversion and possibly unbounded response times,
a real-time VM (with priority inheritance) is recommended
when using real-time
elements which are not mutex-free.public abstract String comment
""
).Copyright © 2005-2013 Javolution. All Rights Reserved.