Skip to content

[bbq2]: mpsc notifier isn't quite right #111

@jamesmunns

Description

@jamesmunns

Right now the MPSC impl queues producers if getting the grant fails, but the mpsc notifier queue is only for "not full", but a grant can fail for two reasons:

  • the queue is full (this is right)
  • a grant is already active

Right now we have no way of notifying that a producer grant is complete other than when a grant has been consumed ("not full"). What we want:

  • Task A takes a write grant async, gets it
  • Task B tries to take a write async, grant is in progress, task B is queued
  • Task A commits the grant
  • At this point, Task B should be notified
  • If a new task, Task C, tries to take a write grant, it should instead be queued instead of getting the grant before B

This also gets tricky if the queue becomes not-full, BUT there is not enough free space for the requested grant. e.g. Task B wants 128B, but the consumer only released a 64B grant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions