news:27e050a5-efd9-49c2...@p9g2000vbb.googlegroups.com...
> On Dec 17, 12:58 am, "Chris M. Thomasson" <
cris...@charter.net> wrote:
> > "aminer" <
amine...@gmail.com> wrote in message
> >
> > news:483dd461-9327-4622...@i8g2000vbh.googlegroups.com...
> >
> > > I have tested you queue with 2 threads, and it gives very bad
> > > performance.
> >
> > What was the size of N? I only have it set to 4 in my crude example.
> > Also, I
> > did nothing to prevent false sharing simply because I don't know how to
> > explicitly pad to cache line and align on cache line boundary in Pascal.
> > Perhaps you can help me out with that... Something like this:
> >
> >
http://groups.google.com/group/comp.programming.threads/msg/f2b1cac59...
> >
> > how can I do that in Pascal?
> You can do this for example:
> type
> typecache1 = array[0..15] of longword;
> and do something like this:
> var
> tail:longword;
> tmp1:typecache1;
> head: longword;
Okay. I can do something with that; thank you. However, I still am wondering
how to actually align data-structures on cache line boundaries. This is very
important because if the data-structure is padded but _not_ properly
aligned, you can still get false sharing. Basically, I want to know how to
perform pointer arithmetic such that I can get the queue aligned properly?
> Also, it really needs distributed conditional blocking mechanism.
>
> > Can you please do your benchmarks with multiple threads and give us
> > the throuput ?
I should have a crude C test program up by the end of today or the middle of
tomorrow. I will test against Dmitriy's awesome queue algorithm, and the
dual spinlock queue (e.g., the one that you are using).
> I am going to implement it in C very soon and eliminate false sharing
> wherever I can. I will post the code here. The only other algorithm I
> think
> I can benchmark against is this beautiful algorithm invented by Dmitriy
> Vyukov:
>
>
http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpm...
>
> IMVHO, it's the only one I can find that is comparable.
>
> > example my lockfree_mpmc on an Intel Core 2 Quad Q6600:with 4 cores
> > and 4 threads
> > under contention does give a throuput of:
> > 38 millions of pop transactions/s
> > and
> > 9 millions of push transactions/s
>
> Can you show me the code?
> Here is the code:
>
http://pages.videotron.com/aminer/zip/lockfree_queue.zip
> Just compile the pop.pas and push.pas tests examples that you
> will find inside the zip file....
Sorry, but I cannot find my queue code in there. Can you please provide me
with the test you used for my algorithm specifically. I say "specifically"
simply because the pop and push tests you are using are _not_ compatible
with my mpmc queue interface. You seem to be expecting a boolean return
value indicating full/empty border conditions. My queue implicitly blocks on
such conditions. AFAICT, Pascal won't even compile my queue interface WRT
your test harness. BTW, I still need to know what the size of N was. I
cannot see my algorithm in the zip file, therefore, I cannot test my own
algorithm without altering your existing test code.