Skip to content

Finish the Chan/Port types #10459

Closed
Closed
@alexcrichton

Description

@alexcrichton

Right now these types have a few shortcomings, all of which need to get addressed for 1.0. Some specific problems with these types:

  • try_send/try_recv are bad names for what they actually do. Right now they will block and then return None when the other side disconnects. send/recv on the other hand will block, and fail!() if the other side disconnects. Almost everyone expects try_send/try_recv to not block and immediately return (returning whether there was something on the channel/port). We want both modes of operations, but clear names for them.
  • querying whether the other side has been disconnected. This is similar to the above point, but possibly distinct depending on the choice of functions. A channel should be able to query whether the other side has hung up or not.
  • Seamlessly work on and off the runtime. I should be able to create a stream anywhere in any situation and have it "just work" what this really means is that when we're on the runtime, we use the scheduler to block. When we're off the runtime, we use a native condition variable to block. This supports the "Communication" portion of Support 1:1 Scheduling #10493.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions