← back
Never miss a thing.
One email per new article, plus upcoming course announcements, nothing else. The full tech-watch news, figures and gifts are reserved for Subscriber Area members.
Discuss this article with your AI
The button copies the article with a short introduction for the model. Paste it all into Claude, ChatGPT, Le Chat or another AI, then ask it your questions.

PriorityQueue - Rust #002 - Fairness

This video is in French.

In this second episode, we enhance our Priority Queue to add fairness between producers.

We introduce entities, a mechanism inspired by fair scheduling, so that no single source can monopolize the queue.

What you will learn

Technologies: Rust, Cargo, HashMap, VecDeque, HashSet. Level: intermediate to advanced.

This step prepares the rest of the series: we will move to concurrency, with a multithreaded then asynchronous version under Tokio.

Source code: github.com/xigh/pq-async-rs

PriorityQueue in Rust

  1. PriorityQueue - Rust #001
  2. PriorityQueue - Rust #002 - Fairness
  3. PriorityQueue - Rust #003 - Multithreading
  4. PriorityQueue - Rust #004 - Blocking Dequeue
  5. PriorityQueue - Rust #005 - Graceful Shutdown
  6. PriorityQueue - Rust #006 - async/await