-
Notifications
You must be signed in to change notification settings - Fork 68
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
Allow newly spawned domains to have a copy of the parent domain's local state #587
Comments
Currently (in #582) domain-local state is initialized with a It is possible to emulate One downside of the |
The latest proposal for a splittable Random module (ocaml/ocaml#10742) has |
If I understand correctly, we would need this "lazy split" to modify the parent generator from the child domain, which would require synchronization, right? (This would also not be deterministic.) |
What I meant: some DLS slots, such as the slot for the PRNG state, are declared "initialized by parent domain", and the computation of the initial value is run in the parent domain; while other slots are declared "initialized by child domain", and the computation of the initial value is run in the child domain, probably at first lookup, like in the current implementation. So, there is no lazy split of a PRNG state. But there can be lazy initialization of other DLS slots, either because the initialization must be run on the child domain (e.g. it refers to the child domain identifier), or just because it's more efficient. |
Fixed by ocaml/ocaml#10887. |
Currently, when domains are spawned, their domain-local states start off as empty. It is conceivable that one may want a newly-spawned domain to have a copy of the parent state rather than starting a fresh. This feature was suggested by @lpw25 here.
This feature can be implemented fairly easily by copying the parent domain's domain local state array.
The text was updated successfully, but these errors were encountered: