Skip to content

Commit

Permalink
WIP: DLS debugging, remove an extra call to [caml_dls_dget]
Browse files Browse the repository at this point in the history
The call was placed here for thread-safety, to work correctly if
another thread (on the same domain) resizes the DLS array under our
feet. It is also the only notable change in terms of access to
`Caml_state->dls_root` since 5.1, so it might be involved in the
mysterious crash being investigated at

  ocaml-multicore/multicoretests#446
  • Loading branch information
gasche committed Jun 3, 2024
1 parent 23d8967 commit bf48bf7
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions stdlib/domain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,6 @@ module DLS = struct
else begin
let v : a = init () in
let new_obj = Obj_opt.some (Sys.opaque_identity v) in
(* At this point, [st] or [st.(idx)] may have been changed
by another thread on the same domain.
If [st] changed, it was resized into a larger value,
we can just reuse the new value.
If [st.(idx)] changed, we drop the current value to avoid
letting other threads observe a 'revert' that forgets
previous modifications. *)
let st = get_dls_state () in
if array_compare_and_set st idx obj new_obj
then v
else begin
Expand Down

0 comments on commit bf48bf7

Please sign in to comment.