Open eupp opened 2 months ago
There is a soft dependency on #387 : until we implement it, it would be possible to test only single threaded code (useless). But we still can start prototyping and developing this feature independently, and then merge with the custom threads support.
One of the features of Lincheck framework is the concurrent code model checker.
Currently the model checker functionality in Lincheck is toughly coupled with the Lincheck's data structures testing API. This approach has its benefits: it provides a convenient end-to-end testing experience for users who want to test their concurrent data structures. However, for some use cases it is less convenient: sometimes users just want to run a piece of concurrent code in a model checking mode, exploring different possible interleavings.
Some examples of code that cannot be easily tested currently with Lincheck are thread pool implementations, parallel executors, coroutine schedulers, etc.
We aim to provide a simpler API to run model checker on an arbitrary code snippet (subject to a few constraints).
Overview of the API
Here is how the current data structures model checking API looks like:
Here is how a concrete test for the counter with the general-purpose model checking API would look like:
The concrete API is under discussion, but the general idea should stay the same.