Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compile and run this

32 views
Skip to first unread message

Rick C. Hodgin

unread,
Mar 8, 2017, 8:01:30 AM3/8/17
to
On Tuesday, March 7, 2017 at 4:41:22 PM UTC-5, Chris M. Thomasson wrote:
> Hey Rick, I am wondering if you can compile and run this:
> http://pastebin.com/raw/hXQfrCSN

What is it?

Thank you,
Rick C. Hodgin

Chris M. Thomasson

unread,
Mar 8, 2017, 8:17:32 PM3/8/17
to
On 3/8/2017 5:01 AM, Rick C. Hodgin wrote:
> On Tuesday, March 7, 2017 at 4:41:22 PM UTC-5, Chris M. Thomasson wrote:
>> Hey Rick, I am wondering if you can compile and run this:
>> http://pastebin.com/raw/hXQfrCSN
>
> What is it?


A distributed, bounded, multi-producer/consumer concurrent queue. It can
be used in different ways, but wrt the sample code, it is used as an
event queue for two threads, a producer and a consumer.

For now, the test only focuses on two threads. Fwiw, the spin waits on
boundary conditions can be removed by fast-pathed eventcounts. What are
eventcounts? Well, they are akin to condition variables for non-blocking
algorithms. Here is the original one I did some years ago:

https://groups.google.com/d/topic/comp.programming.threads/qoxirQbbs4A/discussion

http://www.1024cores.net/home/lock-free-algorithms/links
search the page text for SenderX... ;^)

Fwiw, this test focuses on using the multi-producer/consumer queue for
single-producer/consumer in spin mode. Well, wrt single
producer/consumer, we can get rid of the XADD's!

There will be more to come.

0 new messages