-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation requests #13
Comments
Will come back with more on the other points in a few days. First, we should change the README. dscheck doesn't exhaustively explore all interleavings, only all interleavings that have conflicting atomic operations which could cause a race. Consider two atomic variables
--
The implementation of DPOR in dscheck will cull the search space for one of those two orderings of the read of Second, yes it is expected that every execution won't run to completion. To make the implementation a little less hairy and to cope without multishot continuations, we internally work with schedules. These are the series of operations and the process (thread) to run next at each atomic operation. We have Third, spawns aren't run immediately. Your Given the above in one and two you probably don't want to be using shared non-atomics between the Atomic spawns. I have to run but will come back to this tomorrow. |
I think I'm a bit confused about how to use dscheck. Perhaps other people will be too.
The README says:
I tried adding some prints to it:
Many of the runs don't seem to finish. Is this expected? e.g. I get:
It would be useful if it could run without logging while searching, and then run the failing test case again with logging on. The default trace output doesn't seem very useful (e.g. it's hard to know what
Process 3: compare_and_swap 14
is referring to).I had assumed I could use non-atomic variables to keep track of the expected state and then compare that against the atomic values. e.g. adding a value to a lock-free queue and also to a regular
Stdlib.Queue
and checking the final contents are the same. Is that unsafe?Does
Atomic.spawn
always run the function immediately, up to the first atomic operation? For example, this doesn't find the error:But switching the order of the spawns does find it. I guess if another process depends on the value then I need to use an atomic.
I tried doing this to encourage it to switch:
That worked if I put it in both spawns, but not in just one of them.
Basically, it would be useful to know what things are safe to do and which prevent it from testing all cases.
(Also: the example in the README doesn't do anything unless you add
let () = Atomic.trace test_counter
. It would be good to include this - maybe tested with MDX?).The text was updated successfully, but these errors were encountered: