Skip to content
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

Tests linearizability with threads #1

Merged
merged 9 commits into from
Mar 1, 2022
Merged

Conversation

n-osborne
Copy link
Contributor

Adapt lin_prop for domains and threads so that we can reuse check_seq_cons.
Tests for linearizability with thread are added in src/lin_test.ml

@jmid
Copy link
Collaborator

jmid commented Feb 21, 2022

Great - thanks! 👍‍ 😀

A couple of random questions:

  1. Have you tried running the tests locally to see if the tests finds thread-unsafe ones (refs, clist, ... perhaps)?
  2. I can see why we need to communicate results back to the original thread, but I'm a bit hesitant about the
    new dummy : res value, as it adds another definition for a client to specify.
    I would therefore like to understand your reason for choosing this design:
    Did you observe problems with triggering errors or shrinking when the threads would allocate, e.g., compared to
    building up a result list and storing it in a shared ref when a thread is done?
  3. The domain tests are repeating each test instance to "make the output more deterministic" 😉
    Did you observe whether the thread tests need less/same/more repetitions to trigger and produce small counterexamples?

- use arrays to communicate results of computation as threads don't return them
- should be able to reuse `check_seq_cons'
- keep `lin_test' but add a parameter to choose the kind of concurrency that is tesed (Domain or Thread for now)
- FIXME: `Unbound module Thread'
fix some type mistakes
todo: fix existing tests for domain and add some for thread
had to add a pause in the not atomic implementation of add
- works for ref test with Thread
- doesn't work for CList test with Thread
@jmid jmid merged commit cabe113 into ocaml-multicore:main Mar 1, 2022
jmid pushed a commit that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants