Hey /prog/, for the Peterson Leader Election, if I'm using channels between the nodes with a queue in a multithreaded program, do I need to make the queue in each channel equal in size to the number of nodes?
tl;dr n nodes means n size of queue in channels in peterson leader election?
Name:
Anonymous2010-10-25 0:35
No
Name:
Anonymous2010-10-25 0:48
Then why does my teacher say so? It seems I just need to use a semaphore to be sure a channel is only being used by one thread at a time to pass info between nodes... I guess I'm confused.
/prog/ isn't a good place to ask for homework help, especially if you don't know how to ask good questions.
Name:
Anonymous2010-10-25 1:38
It's not homework help per se, he gives us certain things that might be on the test that we need to know how to implement, PLE is giving me some trouble, and googling it only leads to homework assignments from other universities...
I guess I'm asking what's the most efficient way to do it? A single variable to hold the value passed through the channel, and a 3 value array in the node, or a 3 value array in the channel ignoring semaphores and just going for semaphores on use of the node for value application... Oh well, /prog/ is too slow I'll just make a few test progs.
Fuck, are you retarded? It took me 30 seconds of Googling and 10 seconds of thinking to understand the entire algorithm up to the point of being able to implement a simulation for it.
Name:
Anonymous2010-10-25 20:54
>>6
>Hurp, are you derp? It herp me 30 seconds of derp hurp derp de derpa derpa doo up to the derp of herpa derp to derp a herp for it.