aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/concurrent
Commit message (Collapse)AuthorAge
* Allow AbstractQueueVisitor implementations to introspect on active worker ↵Gravatar Eric Fellheimer2016-03-04
| | | | | | | count and possibly use that value to make dynamic decisions around scheduling. -- MOS_MIGRATED_REVID=116351222
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Distinguish between read and write locks for KeyedLocker.Gravatar Janak Ramakrishnan2015-12-10
| | | | | -- MOS_MIGRATED_REVID=109835697
* Replace AtomicBoolean with volatile boolean field in AbstractQueueVisitorGravatar Mark Schaller2015-11-25
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=108707405
* Avoid low-value boxing of longs in AbstractQueueVisitorGravatar Mark Schaller2015-11-25
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=108641543
* Reduce AutoBoxing-induced GC churn by using AtomicLongMap.Gravatar Eric Fellheimer2015-11-16
| | | | | -- MOS_MIGRATED_REVID=107806099
* Introduce ForkJoinQuiescingExecutor, permit its use in evaluationGravatar Mark Schaller2015-11-02
| | | | | | | | | | | | | | | | | | This CL introduces a QuiescingExecutor implementation specialized for ForkJoinPools with the same interrupt handling, error propagation, and task completion semantics as AbstractQueueVisitor. Currently it does this by largely sharing its implementation with AQV. Future refactoring could let it rely more on ForkJoinPool's own awaitQuiescence implementation to avoid the overhead of AQV's remainingTasks counter maintenance. Subtasks spawned by tasks executing in ForkJoinQuiescingExecutor will rely on ForkJoinPool's thread-local task deques for low contention and (mostly) LIFO ordering. -- MOS_MIGRATED_REVID=106864395
* Fix AbstractQueueVisitor synchronization, comments, and field namesGravatar Mark Schaller2015-11-02
| | | | | | | | | | | | | | | | This fixes the following synchronization issue with AbstractQueueVisitor's jobsMustBeStoppedField: it was read in awaitTermination in a block synchronized on zeroRemainingTasks, but in markToStopAllJobsIfNeeded it was read and written in a block synchronized on the AQV instance. Now, it is always read or written in a block synchronized on zeroRemainingTasks, because it is used in the condition represented by that object. This also thoroughly cleans up obsolete and irregular documentation in the class. -- MOS_MIGRATED_REVID=106849236
* Cleanup ValueVisitor (and dirty QuiescingExecutor)Gravatar Mark Schaller2015-11-02
| | | | | | | | | | | | | Raises the level of abstraction of ValueVisitor's dependence on AbstractQueueVisitor. Except for the "ForTestingOnly" methods now available on the QuiescingExecutor interface, ValueVisitor is agnostic to the implementation of its executor. This also cleans up the full spectrum of visibility modifiers on ValueVisitor methods, all of which ought to be private. -- MOS_MIGRATED_REVID=106847453
* Introduce ErrorClassifierGravatar Mark Schaller2015-11-02
| | | | | | | | | | Changes the AbstractQueueVisitor strategy for varying its response to unhandled exceptions from inheritance to composition. This will help with a forthcoming switch from inheritance to delegation for ValueVisitor's use of AbstractQueueVisitor. -- MOS_MIGRATED_REVID=106730708
* Introduce QuiescingExecutorGravatar Mark Schaller2015-11-02
| | | | | | | | | | | | This interface (mostly) encapsulates what the ValueVisitor expects from the AbstractQueueVisitor class it currently inherits from. This makes it easier for a future CL to change ValueVisitor's strategy of code reuse from inheritance to composition. RELNOTES: -- MOS_MIGRATED_REVID=106728863
* Process tasks in the AbstractQueueVisitor in LIFO order as opposed to FIFO ↵Gravatar Janak Ramakrishnan2015-10-22
| | | | | | | | | order. In general, there's no advantage in Blaze to FIFO, and it means that we effectively do breadth-first graph traversal. When we must hold state for incomplete nodes (as we do with action execution, or more generally, as we do in Skyframe), this increases our memory footprint. LIFO is not exactly depth-first traversal, since we are multithreaded, but to a first approximation, it looks like a depth-first traversal with "width" the number of threads (at each level of the graph, #(threads) nodes are visited). -- MOS_MIGRATED_REVID=105995014
* Don't log SchedulerExceptions.Gravatar Nathan Harmata2015-10-20
| | | | | | | RELNOTES: None -- MOS_MIGRATED_REVID=105787681
* Mostly lockless updates of remainingTasks counterGravatar Mark Schaller2015-10-14
| | | | | | | | | Uses an AtomicLong to count remaining tasks. Only obtains the zeroRemainingTasks lock when remaining tasks have gone to zero or the codepath needs to wait on that condition. -- MOS_MIGRATED_REVID=105348523
* Minor tidying of AbstractQueueVisitorGravatar Mark Schaller2015-10-13
| | | | | | | | | | Removes unnecessary final keyword on private methods, inlines the un-overridden protected method getWorkQueue, and restructures internal constructors to be flatter (i.e. every constructor implementation calls at most one other constructor). -- MOS_MIGRATED_REVID=105344413
* Allow other ExecutorService implementations in AbstractQueueVisitorGravatar Mark Schaller2015-10-13
| | | | | | | Previously, only ThreadPoolExecutor implementations were allowed. -- MOS_MIGRATED_REVID=105340237
* Delete unused method in AbstractQueueVisitor.Gravatar Janak Ramakrishnan2015-10-13
| | | | | -- MOS_MIGRATED_REVID=105312426
* Log immediately when AbstractQueueVisitor encounters a critical error.Gravatar Eric Fellheimer2015-10-12
| | | | | | | If there's a holdup propagating the exception, at least we will see it in the logs. -- MOS_MIGRATED_REVID=105075242
* Refactoring: Move ThreadPoolExecutorParams to top-level.Gravatar Eric Fellheimer2015-09-30
| | | | | -- MOS_MIGRATED_REVID=104250152
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Move callUninterruptibly to a helper class in lib.concurrent.Gravatar Ulf Adams2015-09-24
| | | | | -- MOS_MIGRATED_REVID=103747062
* workers: Make sure to wait for worker processes to exit so that they don't ↵Gravatar Philipp Wollermann2015-09-21
| | | | | | | become zombies. -- MOS_MIGRATED_REVID=103541217
* Don't allow subclasses of AQV to treat Errors as non-critical. Also update ↵Gravatar Nathan Harmata2015-09-16
| | | | | | | the documentation for AQV#work to reflect the semantics of critical errors. -- MOS_MIGRATED_REVID=103140100
* Fix very minor concurrency issue in AQV. 'unhandled' doesn't have memory ↵Gravatar Nathan Harmata2015-09-16
| | | | | | | visibility from other threads, so we may end up storing the non-first unhandled exception and/or decline to not run new tasks because we don't realize there already is an unhandled exception. -- MOS_MIGRATED_REVID=103127733
* Add a new KeyedLocker, StripedKeyedLocker. This new implementation simply ↵Gravatar Eric Fellheimer2015-09-03
| | | | | | | stores a striped set of reentrant locks. -- MOS_MIGRATED_REVID=102198213
* Increase number of stripes in our keyed locker.Gravatar Eric Fellheimer2015-08-18
| | | | | -- MOS_MIGRATED_REVID=100843669
* Delete Batch locking, which is unused as of this CL.Gravatar Eric Fellheimer2015-08-12
| | | | | -- MOS_MIGRATED_REVID=100399962
* Use Multiset#remove(object, int) to avoid having to query the count after ↵Gravatar Nathan Harmata2015-08-11
| | | | | | | removing the key. -- MOS_MIGRATED_REVID=100314916
* Add threadpool injectability to invalidatorGravatar Mark Schaller2015-08-06
| | | | | -- MOS_MIGRATED_REVID=99961435
* Rollback of commit 6f049bb19941b89d16364b26cca66aae09f9cb42.Gravatar Nathan Harmata2015-06-26
| | | | | | | | | | | | | *** Reason for rollback *** Ended up not being necessary; I was able to rephrase things using SettableFuture instead. *** Original change description *** Introduce a simple concurrent Multimap-like data structure with reference counting. -- MOS_MIGRATED_REVID=96884190
* Renaming ExecutorShutdownUtil to ExecutorUtil, since it doesn't just do ↵Gravatar Eric Fellheimer2015-06-19
| | | | | | | shutdown operations. -- MOS_MIGRATED_REVID=96351438
* Introduce a simple concurrent Multimap-like data structure with reference ↵Gravatar Nathan Harmata2015-06-16
| | | | | | | counting. -- MOS_MIGRATED_REVID=96024804
* Change getBatch signature from Set to Iterable since Iterable is all that's ↵Gravatar Janak Ramakrishnan2015-04-30
| | | | | | | needed. Also clean up some lint warnings/unresolved references. -- MOS_MIGRATED_REVID=92380618
* Introduce KeyedLocker#lockBatch, which does what it sounds like it does.Gravatar Nathan Harmata2015-04-06
| | | | | -- MOS_MIGRATED_REVID=90282858
* Some minor improvements to KeyedLocker:Gravatar Nathan Harmata2015-04-03
| | | | | | | | | | | (i) Change the semantics of KeyedLocker.AutoUnlocker#close such that it can be called at most once per AutoUnlocker instance. (ii) Change KeyedLocker.AutoUnlocker#close to throw a IllegalUnlockException (RuntimeException) on error, rather than leave the behavior intentionally underspecified. (iii) explicitly mention in AutoLocker#lock that a thread can call lock(k) multiple times before unlocking. Combined with (i), this implies that KeyedLocker#lock implementations will want to return fresh AutoUnlocker instances. These semantics are bit nicer to use anyway, but I also want them because I will soon be introducing KeyedLocker#lockBatch, and it's much easier to specify that given the above. -- MOS_MIGRATED_REVID=90259645
* Introduce KeyedLocker, a nice concurrency abstraction for managing lots of ↵Gravatar Nathan Harmata2015-03-10
| | | | | | | mutexes, and RefCountedMultisetKeyedLocker, an efficient implementation of this abstraction. -- MOS_MIGRATED_REVID=88000985
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957