-
Notifications
You must be signed in to change notification settings - Fork 19
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
Create Synchronzier module #360
Conversation
Because Ocaml does not possess an optimizing compiler, we should check that this does not tank performances and manually add [@@inline] where needed to try and salvage what demands salvation. |
Can you add a |
type ('get, 'write) t = | ||
{ mutex : Mutex.t | ||
; cond : Condition.t | ||
; getter : unit -> 'get option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that this is a closure that when called, gets one element to run, without caring for synchronization. Typically, for a Queue, this is fun () -> Queue.take_opt q
, and for concolic this will be fun () -> find_node_to_run tree
.
913631d
to
94292bf
Compare
Once this is effectively used in concollic, I'll add documentation and close #363 |
I'm asking for a |
Yes, I have added a mli :) |
match get q true with | ||
| None -> () | ||
| Some v -> | ||
let () = f v (fun v -> write v q) in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f v ...;
was more idiomatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But didn't constrain the return type to be unit.
Thanks! |
No description provided.