◐ Shell
clean mode source ↗

Message 70603 - Python tracker

For the connection refused error, the following script fails for me 
(again, on OS X 10.5.4) with the message:

errno: [Errno 61] Connection refused

on most runs.  (If xrange(10) is replaced by a smaller range like 
xrange(4) then the script usually runs without error.)  Looks like
something in semaphore.c needs fixing, but I've no idea what.



from multiprocessing import Process, Manager
sleeping = Manager().Semaphore(0)

def f():
    sleeping.release()

for _ in xrange(10):
    Process(target=f).start()
for _ in xrange(10):
    sleeping.acquire()