On Fri, Nov 16, 2018 at 11:15 AM by byaiu <boycefi...@gmail.com> wrote:
>
> Hi,
> I'm reading <<Intrusive MPSC node-based queue>> and found the code in 
> mpscq_push `mpscq_node_t* prev = XCHG(&self->head,n)` confusing.
> mpscq figure

Hi by,

I don't have permissions to view the link you posted.

I assume you mean this algorithm:
http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue

> 1. does the head and n point to the right address before and after the XCHG?

I am not sure what you mean by "right".
n is pointer to new node that needs to be enqueued. It is function
argument and is not changed by XCHG.
To the best of my knowledge head points to a right address. If I knew
about a bug in the algo, I would fix it.

> 2. where should prev point to?

prev points to the node that was head of the queue before XCHG operation.

Do you have some concrete scenario that you think is broken, or you
are confused about? If yes, describe 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/CAEeQi3s9hvaRLEWYUjgE5QUXiXhSk9prSgf%3DyeXoSk2oodxDWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to