Yury Yaroshevich c325421927 Do not explicitly create threads in PacketQueue (#157)
* Do not explicitly create threads in PacketQueue, but borrow threads for execution from ExecutorService.

* Added method to release created packet in PacketQueue.

* Added constructor overload to override default ExecutorService of PacketQueue.

* Fixed inconsistent formatting.

* Added throttling support to PacketQueue.

* Added performance tests for various configurations of PacketQueue.

* Updated comments.

* Added test for fixed size thread pool to compare it with ForkJoinPool.

* Fixed comments.

* Changed default values of PacketQueue configuration to closer match old implementation.

* Removed unused constants.

* Added tests to reveal introduced bug. Fixed bug.

* Fixed comments in PacketsQueue.

* Do not hard code class name in thread pool name.

* Return 0 when handler is null (should be not be reachable, but anyway).

* Added test to check capacity constraint of PacketQueue.

* Replaced manual capacity check with checking offer return value.

* Made throttler class static.

* Added test to check that PacketQueue thread is release without work.

* Do GC before running performance benchmark.

* Fixed formatting and added timeout.

* Added test to check cooperative multi-tasking behavior when executor is shared between queues and has less threads then executor has.

* Minor code rearrangement.

* Use dedicated syncronization object for sate of AsyncPacketReader.

* Stop PacketQueue when benchmark is finished.

* Added constant for number of benchmark iterations.

* Minor code style enhancements.

* Added myself to the list of authors.

* Added test to check that million of PacketQueue can share single thread without eating CPU when idle.

* Extracted AsyncQueueHandler class.

* Fixed imports.

* Minor fixes.

* Minimize diff by undoing unnecessary changes.

* Minimized diff.

* Reduce diff.

* Added constructor argument null checks.

* Removed throttling and simplified AsyncQueueHandler.

* Reviewed usage of syncronized blocks.

* Moved variable closer to usage.

* Fixed according to code review.

* Added extra constructor.

* Removed cancel from onYield because it's unnecessary after removing throttling.

* Rearranged onYield and handleQueueItemsUntilEmpty, introduced rescheduleReader

* Updated copyright.
2018-12-12 08:37:28 -08:00
..