Bug 2129304 - Review Request: moodycamel-readerwriterqueue - A single-producer, single-consumer lock-free queue for C++
Summary: Review Request: moodycamel-readerwriterqueue - A single-producer, single-cons...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: FE-NEEDSPONSOR FE-Legal
TreeView+ depends on / blocked
 
Reported: 2022-09-23 09:27 UTC by Sergey
Modified: 2022-11-11 10:26 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-11-11 10:26:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sergey 2022-09-23 09:27:55 UTC
Spec: https://download.copr.fedorainfracloud.org/results/snmende/moodycamel-readerwriterqueue/fedora-rawhide-x86_64/04881538-moodycamel-readerwriterqueue/moodycamel-readerwriterqueue.spec
SRPM: https://download.copr.fedorainfracloud.org/results/snmende/moodycamel-readerwriterqueue/fedora-rawhide-x86_64/04881538-moodycamel-readerwriterqueue/moodycamel-readerwriterqueue-1.0.6-1.fc38.src.rpm
Description: A single-producer, single-consumer lock-free queue for C++

An original implementation of a lock-free queue designed from scratch for C++.
It only supports a two-thread use case (one consuming, and one producing). 
The threads can't switch roles, though you could use this queue completely 
from a single thread if you wish (but that would sort of defeat the purpose!).


Features:

- Blazing fast
- Compatible with C++11 (supports moving objects instead of making copies)
- Fully generic (templated container of any type) -- just like `std::queue`, 
  you never need to allocate memory for elements yourself (which saves you 
  the hassle of writing a lock-free memory manager to hold the elements 
  you're queueing)
- Allocates memory up front, in contiguous blocks
- Provides a `try_enqueue` method which is guaranteed never to allocate 
  memory (the queue starts with an initial capacity)
- Also provides an `enqueue` method which can dynamically grow the size of
  the queue as needed
- Also provides `try_emplace`/`emplace` convenience methods
- Has a blocking version with `wait_dequeue`
- Completely "wait-free" (no compare-and-swap loop). Enqueue and dequeue 
  are always O(1) (not counting memory allocation)
- On x86, the memory barriers compile down to no-ops, meaning enqueue and 
  dequeue are just a simple series of loads and stores (and branches)

Fedora Account System Username: snmende
Build: https://copr.fedorainfracloud.org/coprs/snmende/moodycamel-readerwriterqueue/build/4881538/

Comment 1 Benson Muite 2022-09-30 16:28:09 UTC
Thanks for this. Any idea on patents? https://moodycamel.com/blog/2013/a-fast-lock-free-queue-for-c++ indicates that though the code is BSD, but that there are many patents in this area, for example https://patents.google.com/patent/US8543743B2/en  I expect this only applies to the multi-producer and multi-consumer queue as it is packaged in Debian https://packages.debian.org/source/bullseye/readerwriterqueue

Possibly consider updating the description to (remove "I" which is unclear when not in the repository, and remove external references):

An original implementation of a lock-free queue designed from scratch for C++.
It only supports a two-thread use case (one consuming, and one producing). 
The threads can't switch roles, though you could use this queue completely 
from a single thread if you wish (but that would sort of defeat the purpose!).

Comment 2 Sergey 2022-09-30 22:41:46 UTC
(In reply to Benson Muite from comment #1)
> Thanks for this. Any idea on patents?
> https://moodycamel.com/blog/2013/a-fast-lock-free-queue-for-c++ indicates
> that though the code is BSD, but that there are many patents in this area,
> for example https://patents.google.com/patent/US8543743B2/en  I expect this
> only applies to the multi-producer and multi-consumer queue as it is
> packaged in Debian
> https://packages.debian.org/source/bullseye/readerwriterqueue

No, Benson, an I have no idea how to proceed. The patent you refer, covers 
multi-consumer implementation as I got, though looks very similar. Do we have
any people who is experienced with this and could help necessary checks?

> Possibly consider updating the description to (remove "I" which is unclear
> when not in the repository, and remove external references):

I updated the spec and rebuild package. The OP is updated.

Sergey

Comment 3 Benson Muite 2022-10-01 11:52:23 UTC
Thanks for the update. Added legal, can also ask on legal list.


Note You need to log in before you can comment on or make changes to this bug.