rust-embedded / rust-embedded/heapless

MpMcQueue drop implementation is not optimized

Open
#489 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
2k
Forks
253
Avg merge
1d 2h
Merged PRs (30d)
1

Description

The MpMcQueue  drop implementation is not optimized, as it uses the normal dequeue method, which assumes a shared reference and prevents race condition. drop gives us a mutable reference, which means that the implementation could skip the atomic operations, and all the care for synchronization.

See https://github.com/rust-embedded/heapless/pull/483#discussion_r1657140475

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start at the MpMcQueue drop implementation and read the linked discussion in pull request 483, focusing on why it currently calls the normal dequeue path. The work is done when dropping the queue avoids unnecessary atomic synchronization while preserving correct cleanup and behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
distributed-systems
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.