As a way to learn D, I am writing a quick test setup for examining different
ways of passing data from one set of threads to another. I am trying a few
kinds of queues (resizeable array with locking, linked list with locking and
lockfree with cas) and trying to also add message passing and then co
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
> On 01/01/2011 06:02 PM, Adam Conner-Sax wrote:
> > As a way to learn D, I am writing a quick test setup for examining different
> > ways of passing data from one set of threads to another. I am tryin
Thanks for trying it!
I've seen that outcome once also but usually I don't get the "in produce(...)"
when it hangs. And I don't get the bus errors (I've gotten them other ways).
I get that I should use spawn (and I am writing a new version to use spawn
everywhere), though I did make it all work
Thanks!
It's OSX, by the way.
So it's clear, I understand that message passing is preferred and I can see how
to
do that (kind of!) but I want to compare the performance to other queue
implementations so I can see that message passing is faster or comparable.
Originally, I was just trying to co
Okay. Here's a working version. Does all the hand-coded queues in old-style
threads and the message passing via spawn.
Code attached.
FWIW, message passing is (in terms of avg and max latency) on par with the
locking
linked-list queues but the lockfree linked list queues are much faster (6x to
My streamlined version of the inter-thread queue tester is more reliable
(though it still freezes sometimes. I am trying to isolate it and will post
if I do).
But running the resulting comparison has led to some observations:
1. As I noted earlier, the lockfree linked-list based queues are the f