Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending can yield the thread #96

Open
NathanRoyer opened this issue Jun 3, 2024 · 0 comments
Open

Sending can yield the thread #96

NathanRoyer opened this issue Jun 3, 2024 · 0 comments

Comments

@NathanRoyer
Copy link

When we call try_send on a sender, here's what I think is happening:

  • ConcurrentQueue::push is called here
  • If the queue is unbounded, Unbounded::push is called here
  • If the queue reached its current capacity, busy_wait is called here
  • Which either spins or yields the thread, as defined here

I find it weird that we end up yielding the thread in async code.
If this is expected, I think it should be documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant