Zombie Process: Child process end, parent class not end
Orphan process: Parent class process over., child process not finished
Process No. 0 is responsible for running, process 1th is responsible for generating, all orphan process shelters (orphan process: parent process over) 1th process, never end!
Linux:
#!/usr/bin/env python#!--*--coding:utf-8--*--" "2018-6-22 21:24:13 Multi-threaded learning" "#The first way to use threading is to call the thread class in threading directly fromThreadingImportThreadImport TimedefTest ():Print("--==== drank too much last night, next time drink a little!!!") Time.sleep (1)defMain ():" "Creating Threads" " forIinchRange (5): #Create a threadt = Thread (target=test) T.start ()if __name__=='__main__': Main ()#The second way to use a thread is to encapsulate it into a class,ImportThreadingImport TimeclassMyThread1 (Threading. Thread):"""create a class to inherit a multithreaded class""" defRun (self): forIinchRange (3): Time.sleep (1) msg="I ' m"+slef.name+'@'+STR (1)#The Name property holds the names of the current thread. Print(msg)if __name__=='__main__': T=MyThread1 () T.start
Day_6.22python Multithreading