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

Split Lin interpretations #66

Closed
jmid opened this issue May 11, 2022 · 4 comments
Closed

Split Lin interpretations #66

jmid opened this issue May 11, 2022 · 4 comments

Comments

@jmid
Copy link
Collaborator

jmid commented May 11, 2022

The MacOS segfault that KC just fixed in ocaml/ocaml#11250 reveals that the threads module performs a number of side-effects when loaded. By having all three of our Lin interpretations (Domain,Thread,Fiber) in the same module requiring threads (even though it isn't used) this means

The latter is naturally less serious than the first.

We should consider splitting the three interpretations up into separate files with separate dependencies such that only the Lin Thread interpretation requires threads.

@jmid
Copy link
Collaborator Author

jmid commented Jun 17, 2022

Ideally a design would

  • allow us to keep a Lin (or STM) specification in one, common file
  • run both a Domain or Thread interpretation from the same specification (for either Lin or STM)
  • allow only the Thread interpretation to require threads
  • (be as simple as possible)

This way

  • a specification is reusable
  • a pure Domain interpretation executable does not perform the side-effecting load of threads
  • one is still able to test this corner-case configuration by loading threads nevertheless
  • one can write the "alternative printer interpretation" (Domain-safety: Atomic: OK ... Hashtbl: No ...) we initially talked about

@n-osborne
Copy link
Contributor

I've begun to experiment with building the Domain and the Thread tests with two different functors in two different files (so we have a STM_Domain.Make(Spec) and a STM_Thread.Make(Spec)), most of the work being done by an intermediary common functor.

There is the question of the sequential agree_test. Do we want also a STM_Sequential.Make(Spec)?
I think it would be cleaner, but maybe there are other options I didn't consider?

@jmid
Copy link
Collaborator Author

jmid commented Jun 20, 2022

Good point! 👍
I think a separate sequential functor would be good - akin to what qcstm offers.

@jmid jmid added this to the First opam release milestone Oct 11, 2022
@jmid jmid changed the title Split Lin interpretations? Split Lin interpretations Oct 13, 2022
@jmid
Copy link
Collaborator Author

jmid commented Nov 16, 2022

Fixed in #164

@jmid jmid closed this as completed Nov 16, 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

No branches or pull requests

2 participants