You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use crossbeam_queue::ArrayQueue;// allow a maximum of two elements.let q = ArrayQueue::new(2);assert_eq!(q.push_displacing(10),None);assert_eq!(q.push_displacing(20),None);assert_eq!(q.push_displacing(30),Some(10));
(not sure on the naming)
Is it possible to implement something like this in theory? (I guess it would require writing to two memory locations atomically at the same time, which there is no way to so, not sure)
If, however, it is possible, I'd be happy to open a PR given some hints how to properly implement it!
The text was updated successfully, but these errors were encountered:
We could in fact change the RingQueue I propose in #789 to return the oldest element instead of dropping it in place. Seems like a great idea to me in fact, I'll look into that hopefully later today.
Essentially I'm looking for something like this:
(not sure on the naming)
Is it possible to implement something like this in theory? (I guess it would require writing to two memory locations atomically at the same time, which there is no way to so, not sure)
If, however, it is possible, I'd be happy to open a PR given some hints how to properly implement it!
The text was updated successfully, but these errors were encountered: