concept thread - safety in category software development

appears as: thread-safety
Test Driven: Practical TDD and Acceptance TDD for Java Developers

This is an excerpt from Manning's book Test Driven: Practical TDD and Acceptance TDD for Java Developers.

As primitive it sounds, a typical approach to testing for thread-safety in the absence of safely accessible invariants is an intelligent brute-force test. By intelligent, we mean a test that is engineered to maximize the chances of error situations taking place during the execution. Typically, this kind of test launches multiple threads to access a given piece of code under test, aiming at as high a concurrency as possible with the use of synchronization objects like barriers and latches. Without the use of rendezvous points like barriers and latches, the overhead of starting threads might even result in entirely sequential execution—with each thread executing to the end before the next one is started.