Parallelize refinement check using threads and message passing #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As requested in #112: Make use of multi-threading in the refinement check.
Introduces a pretty simple parallelization of the refinement check, which can grow to be more complicated in the future.
The refinement check now initializes a set of worker threads that receive state pairs through a channel. The worker threads send back the results to a shared dispatcher which determines when the check is done.
The parallelization uses message passing for sending state pairs between the workers and dispatcher while the workers have a shared state
PassedList
behind a mutex.The overhead of starting threads slows down very fast small queries but makes medium and large queries much faster.
Reveaal can now use all cores instead of just one!
In the future we should probably pass around a thread pool instead of initializing one at every check. When we allow evaluation of multiple queries in parallel we will also need to split resources, as queries shouldn't all use the same logical cores.