multiprocessing signal defect

N

Neal Becker

Seems multiprocessing doesn't behave well with signals:

-----------
from multiprocessing import Pool
import time

def sleep (dummy):
time.sleep (10)

if __name__ == '__main__':
pool = Pool (processes=2)
result = pool.map (sleep, range (4))

-------------

start it up
$ python test_multip.py

----------------------
ps auxf | grep python
nbecker 6605 1.6 0.1 338192 6952 pts/1 Sl+ 08:03 0:00 | \_
python test_multip.py
nbecker 6606 0.0 0.1 186368 4760 pts/1 S+ 08:03 0:00 |
\_ python test_multip.py
nbecker 6607 0.0 0.1 186372 4740 pts/1 S+ 08:03 0:00 |
\_ python test_multip.py

kill 6607
ps auxf | grep python
nbecker 6605 0.5 0.1 338192 6952 pts/1 Sl+ 08:03 0:00 | \_
python test_multip.py
nbecker 6606 0.0 0.1 186368 4760 pts/1 S+ 08:03 0:00 |
\_ python test_multip.py
nbecker 6607 0.0 0.0 0 0 pts/1 Z+ 08:03 0:00 |
\_ [python] <defunct>

kill 6606
ps auxf | grep python
nbecker 6605 0.3 0.1 338192 6952 pts/1 Sl+ 08:03 0:00 | \_
python test_multip.py
nbecker 6606 0.0 0.0 0 0 pts/1 Z+ 08:03 0:00 |
\_ [python] <defunct>
nbecker 6607 0.0 0.0 0 0 pts/1 Z+ 08:03 0:00 |
\_ [python] <defunct>

Now we have 2 dead children and the parent is hung forever.

Isn't this a serious defect?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top