brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <>
Subject [GitHub] incubator-brooklyn pull request: Tasks stop on unmanaged
Date Thu, 16 Oct 2014 23:37:50 GMT
Github user aledsage commented on a diff in the pull request:
    --- Diff: core/src/main/java/brooklyn/util/task/ ---
    @@ -101,24 +95,36 @@
         // TODO Could have a set of all knownTasks; but instead we're having a separate set
per tag,
         // so the same task could be listed multiple times if it has multiple tags...
    -    //access to the below is synchronized in code in this class, to allow us to preserve
order while guaranteeing thread-safe
    +    //access to this field AND to members in this field is synchronized, 
    +    //to allow us to preserve order while guaranteeing thread-safe
         //(but more testing is needed before we are sure it is thread-safe!)
         //synch blocks are as finely grained as possible for efficiency
         //Not using a CopyOnWriteArraySet for each, because profiling showed this being a
massive perf bottleneck.
    -    private ConcurrentMap<Object,Set<Task<?>>> tasksByTag = new ConcurrentHashMap<Object,Set<Task<?>>>();
    +    private Map<Object,Set<Task<?>>> tasksByTag = new HashMap<Object,Set<Task<?>>>();
    --- End diff --
    Just to check... is the reason to use a map we synchronize on (rather than a `ConcurrentHashMap`)
so that we can safely delete the entry when the set of tasks for that key is empty?

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message