microsoft / microsoft/demikernel

Turning from Unbounded AsyncQueue to Bounded AsyncQueue

Open
#1,330 0 comments 0 reactions 1 assignee View on GitHub

@iyzhang is already working on this.

Since Jul 12, 2024.

enhancement
Dominant language
Rust
Stars
1.2k
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Context

Currently, AsyncQueue is unbounded, which can cause the queue to grow indefinitely.

Proposed Solution

One solution would be to use the ArrayDeque of crate::arraydeque and restrict the queue to a fixed value (e.g., 1024). This change maintains the insertion and removal operations that are already in the AsyncQueue, such as push_back, push_front, and pop_front, in addition to basic operations such as len, is_empty, iter, and iter_mut.

Another enhancement involves the use of the Saturating parameter. This feature ensures that when the queue reaches its maximum capacity, any new elements will be automatically discarded, preventing the queue from growing beyond its set limit.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.