Skip to content

Waitqueue as a packed type #102

@tlively

Description

@tlively

The current design for waitqueue has it be a subtype of (rec (type (struct (field (mut i32))))).0 so that normal struct accessors can be used to access its control word while still allowing the engine-internal implementation details to be co-located with that control word. One downside of this design is that it has a non-bottom abstract type as a subtype of a defined type, which has no precedent in the type system and would be difficult for V8 at least to implement.

An alternative design would be for waitqueue to be a packed type like i8 or i16. This would allow it to be "unboxed" directly into structs or arrays, where its control word could still be accessed directly with any struct or array accessor that is allowed to access i32s. The engine could still co-locate the implementation details with the control word since there's no way to observe the actual size of a packed type. We would need struct versions of wait and notify that take struct type and field index immediates, just like any other struct accessor, and array versions that take an array type immediate and an index operand, just like any other array accessor.

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