-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Adapt Gc alarms for multicore #12558
Conversation
The LIFO character is already mentioned in domain.mli.
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.
Looks good to me. (Thanks for the PR-description comment on at_exit
, which was indeed answering a question I was bound to have.)
The PR looks good and happy to go ahead with this. Why is it that we can't have the GC alarm reliably run at the end of every major cycle? |
Oh, we could. As far as I can tell, this involves replacing the current lightweight implementation, which builds on finalisers, with an approach more integrated with the runtime. I do not think it is worth fixing, as explained, but if someone has a better idea then this could be considered. |
By doing a quick code survey on github, I have found that GC alarms have become pretty popular, so I have to retract my claim that nobody cares. I have found many new users of memory limits, for which I have already justified the change in behaviour. But I have also found uses where the alarm does not raise, but instead periodically cleans-up some weak data structure. Here again it does not make sense to start running this operation in an unspecified domain in parallel, as it stands, due to data races. But porting this code to multicore (with ownership transfer of those weak data structures between domains, or with some parallel variants of those data structures) might be tricky. Though it might be an intrinsic limitation of the GC alarm API. |
Do you think it is useful to track reliable GC alarms as a separate issue? |
It might be useful; the code survey did not suggest that it is necessary. |
Ok. In that case, an issue isn't necessary. Thanks. |
Foreword: nobody cares about GC alarms, so let us not waste too much time on this. If you feel like suggesting corrections for typos or wording, please use the github feature for code suggestions so that I can apply them in one click.