Coding Problem (arbitrary thread sych)

Kent Johnson kent at kentsjohnson.com
Sun Feb 26 13:17:38 EST 2006


peleme wrote:
> The threads which arrives to the s function should wait for each other
> until the last one. So A, B, and C executes the last function
> 'together', while D executes it seperate.
> I only know that three threads have to be in synch.

Take a look at the Barrier patter in The Little Book of Semaphores:
http://greenteapress.com/semaphores/

It requires that you know in advance how many threads need to rendezvous 
so you will have to preprocess your args a little.

Kent



More information about the Python-list mailing list