Bug 473441: Fix concurrency issue in ThreadedHistoryTreeBackend
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Mon, 27 Jul 2015 17:13:46 +0000 (13:13 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Mon, 10 Aug 2015 19:17:23 +0000 (15:17 -0400)
commit49698f83d53b1c99ff8cea7eb8b27066cfa30d3a
tree11ea641038dd3a6032a67fa953d472b738813e1c
parent067cd9de1f29337485599f4aa7b594051d7a5f90
Bug 473441: Fix concurrency issue in ThreadedHistoryTreeBackend

We add a blockingPeek() method to the BBQ, which allows blocking
on the queue without removing elements from it. This allows
iterating threads doing query to continue seeing the element
while it is being inserted.

The implementation is changed so that the output buffer remains in the
inner queue until it is empty. Only then is it removed from the inner
queue and the next head of the queue becomes the output buffer.

The iterator is fixed to be a true descending iterator without
duplications and that properly handles concurrent modification of the
inner queue.

The size() method is added.

Change-Id: I9e708824748a625010aded82a3198f096c1fc427
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/52640
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/BufferedBlockingQueueTest.java
common/org.eclipse.tracecompass.common.core/src/org/eclipse/tracecompass/common/core/collect/BufferedBlockingQueue.java
statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/ThreadedHistoryTreeBackend.java
This page took 0.026359 seconds and 5 git commands to generate.