Skip to content

Add support for parallel array initialisation #6

Open
@kayceesrk

Description

@kayceesrk

Array initialisation is likely to be the source of bottlenecks in parallel workloads. Array initialisation for arbitrary typed elements needs to be sequential since the elements need to be initialised to a sensible value before GC gets to see it. However, for primitive types, int and float, one can allow parallel initialisation. OCaml supports Array.create_float, which returns uninitialised array, which can then be initialised in parallel. One can also safely return an uninitialized integer array by

let create_int : int -> int array = Obj.magic (Array.create_float)

Once the array is created, it can then be initialised in parallel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions