-
Notifications
You must be signed in to change notification settings - Fork 2
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
Resource-management for resumptions #3
Comments
I agree, and/but I suspect that sending a PR to propose the new implementation may be more effective, in case @dhil rather prefers to keep this as a low-effort project on the side. |
Let me know what you think @dhil! |
I think it is a good idea! I am interested in exploring such designs. My initial plan was just to replicate |
@gadmm I have managed to get byte code compilation going now. I will look into experimenting with GC'ed resumptions next. |
As a follow-up to the discussion at https://discuss.ocaml.org/t/multi-shot-continuations-gone-forever/9072/13, I think the usual resource-management issues inside resumptions apply to resumptions themselves: currently they have to be dropped manually, which prevents us from referring to them inside other resumptions since it becomes impossible to track when they should be freed.
As suggested in the discussion, one solution is to make resumptions purely GC-managed values. To do so, one can represent a resumption either as a heap value obtained by copying a fiber, or as a fiber which is only discontinued by the GC using a finaliser and which is never reinstated/converted back to a continuation. The interface gets simplified by removal of
demote
,drop
andResumption_already_dropped
.The distinction between linear continuations, which are allowed to own resources, and multi-shot continuations, which are not, could be explained in the documentation, to underline the issues arising from promoting arbitrary continuations.
(cc @gasche)
The text was updated successfully, but these errors were encountered: