FIFO Queue Consensus

What is the exact consensus multi-sender queue number?

I know it is at least 2 :
queue.enq(1)


queue.enq(0)


Streams A and B every call queue.deq()

.
The stream that received 1 will return its own value.
A thread that received 0 will return a different value.

But how to prove that exactly 2 ?
I think I should implement a queue using only 2-consensus objects, but I didn't succeed.

+3


source to share


2 answers


Suppose he can solve the consensus for 3 threads. Consider the critical state in the tree of all possible linearized parallel executions. Take the left side and you will solve 1. Correct and you will solve 0.

Suppose thread A deq () is from the queue and then B deq () is from the queue. Now we have taken the left branch. Suppose then that thread B is deq () from the queue and then A deq () is from the queue. Now we have taken the right branch.



Now, if thread C deq () is out of the queue, it shouldn't care which of the other deq () 'd is first. The queue will look the same either way.

Contradiction: Thread C will solve two different things, even if the execution is identical as far as it goes.

0


source


I think Adar Hefer's answer is correct. However, I think, personal opinion, these formal answers are pain.



As an unofficial answer. If you needed to reach consensus across multiple threads using a FIFO queue, what would you do? So you can store three sentences or more, no problem here. Than you can draw the straws, either WIN, LOSE, or the second LOSE. Still no problem. But how do you get the correct value for "voted"? For WIN, you can just get your threadID, but how do you make sure that both other threads also accept the winner value? If you are the losing thread, from your point of view, you will not be able to see which of the other two threads won. All you know is that you have lost and must accept the other suggested meaning. When gambling, you can draw the correct one, or you may not.

0


source







All Articles