Skip to content

Facilitate starting threads' work at the same time #23

@VsevolodGolovanov

Description

@VsevolodGolovanov

As you yourself apparently noted at https://www.planetgeek.ch/2009/08/25/how-to-find-a-concurrency-bug-with-java/ :

This pattern looks similar to what was generalized into the ConcurrentUnit library for testing multi-threaded code

But there's one thing missing, this part from the article:

// wait until all threads are ready
assertTrue("Timeout initializing threads! Perform long lasting initializations before passing runnables to assertConcurrent", allExecutorThreadsReady.await(runnables.size() * 10, TimeUnit.MILLISECONDS));
// start all test runners
afterInitBlocker.countDown();

Waiting for threads' actual readiness would maximize test's chances at revealing concurrency problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions