Hi all,

Here is <https://github.com/kaynarov/squerrel_queue/blob/master/queue.hpp> 
the bounded MPMC queue that allows chunks of "arbitrary" size to pass 
through it. I have two minor questions:

1. Does it Make Sense?
The idea is that this approach could sometimes be more convenient than 
using pointers, as it eliminates the need to allocate and deallocate memory 
on the fly. 
Furthermore, we often start with raw data (e.g., received from a network) 
to process.

2. Does it Work?
a) gcc-11.4 with tsan shows warnings, even though the tests pass. On the 
other hand, with clang-15, tsan is happy.
Could these warnings be false positives, or have I overlooked some kind of 
bug or fundamental issue?

b) The implementation can suffer from the ABA when the meta_idx counter 
wraps around twice while a thread is stale. 
That's why, in tests, only the SPSC case is presented when Atom == uint8_t 
<https://github.com/kaynarov/squerrel_queue/blob/master/test.cpp#L170>.
While this is more of a theoretical problem for uint64_t, it could 
potentially occur in practice for uint32_t because some bits are allocated 
for data_idx. 
Is there any remedy against it?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Scalable Synchronization Algorithms" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to lock-free+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/lock-free/d795c778-f509-406f-8bfc-c20571f94209n%40googlegroups.com.

Reply via email to