google / google/xls

Add `send_non_blocking`

Open
#965 4 comments 0 reactions 0 assignees View on GitHub
csp enhancement
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

Right now DSLX proc's will always stall on `send`, if no other proc is actively waiting on `recv`.
This approach makes so no data will be lost/dropped, but it takes away control from users.

I propose adding `send_non_blocking` and `send_if_non_blocking`. This way send
will not block pipeline and users will be able to decide, what they want to do with data, like:
* dropping it,
* buffering it,
* sending it over other channel,
* or something else.

These functions would have following signatures:
* `send_non_blocking(:token, :chan<:T>, :T) -> (:token, :u1)`,
* `send_if_non_blocking(:token, :chan<:T>, :u1, :T) -> (:token, :u1)`.

Second element in the tuple is 0/1 flag. If transfer was successful flag
would be high, otherwise it would be low.

/cc @proppy

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.