I used os.waitpid,but I still can't Zombie process?

Donn Cave donn at drizzle.com
Wed Dec 19 06:36:59 CET 2001


Quoth =?gb2312?B?1cXJ2bPb?= <zhangsc at neusoft.com>:

| I still want to kill Zombie process which cause by child process,so I use os.waitpid,But I found Zombie is still exist,why? my program is follows:
| ...
| while 1:
|   ...
|   ret=os.fork() 
|   if ret==0: 
|      HOST=udpaddr
|      PORT=21567
|      ADDR=(HOST,PORT)
|      udpSerSock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
|      udpSerSock.sendto(data,ADDR)
|      udpSerSock.close()
|      break
|   os.waitpid(ret,os.WNOHANG);
|
| Where is my program's error? How to correct my program? Any idea will be appreciated.
|       Edward

WNOHANG means "return right away" - whether before or after receiving the
process' status.  Replace it with 0, if you want to wait for the process
and end its zombie unlife.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list