Skip to content

stdlib concurrency safety documentation, part two: global states#11227

Merged
Octachron merged 1 commit intoocaml:trunkfrom
Octachron:concurrency_alerts_part_two_light
Nov 24, 2022
Merged

stdlib concurrency safety documentation, part two: global states#11227
Octachron merged 1 commit intoocaml:trunkfrom
Octachron:concurrency_alerts_part_two_light

Conversation

@Octachron
Copy link
Copy Markdown
Member

@Octachron Octachron commented Apr 29, 2022

Following #11193 and #11225, this PR adds a new alert in the standard library for global mutable states that are expected to be fully handled by users. More precisely, this PR adds a alert for

  • the whole Arg module: the arguments of the program should be parsed only once.
  • the parameters of the GC, accessible through Gc.get and Gc.set
  • the status of the runtime warnings, exposed by Sys.enable_runtime_warnings and Sys.runtime_warnings_enable
  • the interactive nature of the program, Sys.interactive

There is two other global states present in Hashtbl and Filename: one state tracks if hashtables are randomized by default, and another state stores the directory name for temporary files. However, those two state seem to be a good enough fit for inheritable domain local state, I am thus proposing for now to change their implementation in #11228.

Copy link
Copy Markdown
Contributor

@kayceesrk kayceesrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is reasonable and looks good to me.

@Octachron
Copy link
Copy Markdown
Member Author

I would propose to merge the alert name with the one (once we agree) used in the first PR to avoid duplicating the number of alerts.

@Octachron Octachron force-pushed the concurrency_alerts_part_two_light branch from 81240c5 to 0c291b6 Compare November 24, 2022 10:18
@Octachron Octachron merged commit 4f23169 into ocaml:trunk Nov 24, 2022
Octachron added a commit that referenced this pull request Nov 24, 2022
…light

stdlib concurrency safety documentation, part two: global states

(cherry picked from commit 4f23169)
@Octachron
Copy link
Copy Markdown
Member Author

Cherry-picked on 5.0 as 1deb3e5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants