Skip to content

Add global data API, rewrite chan_from_global_ptr #3915

Closed
@brson

Description

@brson

It would be similar to the local data API, except that values are probably RWARCs for mutable data and ARCs for immutablel data.

Then chan_from_global_ptr could be expressed in terms of the global data API, storing a pipe-based channel, which would get it away from using core::comm.

linenoise also needs a global mutex, which this would provide.

There's some question about where the constructor runs, but the API could just hand you a RWARC<Option<T>> and let you figure it out - presumably anybody using this API would encapsulate it in something else. The hard part is deciding when to do the cleanup and whether to allow destructors. The obvious thing I can think of is to have a weak task do it, and weak tasks have to know not to rely on global data during shutdown.

Like the local data API it would be unsafe until we have a good way to name the key.

Related to #553

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