Skip to content
This repository was archived by the owner on Jun 21, 2024. It is now read-only.
This repository was archived by the owner on Jun 21, 2024. It is now read-only.

Format.printf raises exception when using multiple domains #563

@talex5

Description

@talex5

Running this code with 4.12.0+multicore gives Stdlib.Queue.Empty:

let () =
  let domains = Array.init 7 (fun i ->
    Domain.spawn (fun () ->
          for j = 1 to 10000000 do () done;
          Format.printf "Running in domain %d@." i;
          flush stdout;
      )
    ) in
  Array.iter Domain.join domains
$ ocamlopt -o multi.exe multi.ml && ./multi.exe
Running in domain 0
Running in domain 
1
5
Running in domain Running in domain 2Fatal error: exception Stdlib.Queue.Empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlib safetyMaking stdlib safe for multiple domains

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions