[Python-ideas] channel (synchronous queue)

Sturla Molden sturla at molden.no
Sun Feb 19 19:18:04 CET 2012


Den 19.02.2012 19:07, skrev shibturn:
>
>
> One problem with multiprocessing's Event uses 5 semaphores.  
> (Condition uses 4 and Lock, RLock, Semaphore use 1).  So your Barrier 
> will use 5*numproc semaphores.  This is likely to be a problem for 
> those Unixes (such as oldish versions of FreeBSD) which allow a very 
> limited number of semaphores.

I actually overallocated the number of events, only O(n log n) should be 
needed. So a dict could have been used for sparse storage instead.  
Still that is a lot of semaphores.

Sturla



More information about the Python-ideas mailing list