This test serially fills up a queue and then drains it.
Moduleabstract-deque-tests-0.3Haskell98
Data.Concurrent.Deque.Tests
This module contains a battery of simple tests for queues implementing the interface defined in ` Data.Concurrent.Deque.Class`.
Contents
Synopsis
- value test_fifo_filldrain
- value test_fifo_OneBottleneck
- value tests_fifo
- value test_ws_triv1
- value test_ws_triv2
- value tests_wsqueue
- value test_parfib_work_stealing
- value tests_all
- value numElems
- value getNumAgents
- value producerRatio
- value setTestThreads
- value appendLabels
- value appendLabel
- value stdTestHarness
- type Elt
- value forkJoin
- value timeit
- value fibSize
- Packageabstract-deque-tests-0.3
- Exports19
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceTests.hs
Tests for simple FIFOs.
This test splits the numAgents threads into producers and
consumers which all communicate through a SINGLE queue. Each
thread performs its designated operation as fast as possible. The
Int argument total designates how many total items should be
communicated (irrespective of numAgents).
This creates an HUnit test list to perform all the tests that apply to a single-ended (threadsafe) queue. It requires thread safety at both ends.
Tests for Work-stealing queues.
Trivial test: push then pop.
Trivial test: push left, pop left and right.
Aggregate tests for work stealing queues. None of these require thread-safety on the left end. There is some duplication with tests_fifo.
All deque tests, aggregated.
This requires double ended queues that are threadsafe on BOTH ends.
Testing parameters
How many communicating agents are there? By default one per thread used by the RTS.
It is possible to have imbalanced concurrency where there is more contention on the producing or consuming side (which corresponds to settings of this parameter less than or greater than 1).
Utility for tweaking test suites
Dig through the test constructors to find the leaf IO actions and bracket them with a thread-setting action.
This version has the option of being smarter about how it handles uniformly labeling many tests.
Dig through the test constructors and add a new string to the first label found. If no such label exists, add one.