example - pp \system\processes\fork-count py ""fork basicsstart copies of this program running in parallel with the originaleach copy counts up to on the same stdout stream--forks copy process memoryincluding file descriptorsfork doesn' currently work on windows without cygwinuse os spawnv or multiprocessing on windows insteadspawnv is roughly like fork+exec combination""import ostime def counter(count)for in range(count)time sleep( print('[% =% (os getpid() )run in new process simulate real work for in range( )pid os fork(if pid ! print('process % spawnedpidelsecounter( os _exit( in parentcontinue print('main process exiting 'parent need not wait else in child/new process run function and exit when runthis script starts processes immediately and exits all forked processes check in with their first count display one second later and every second thereafter notice that child processes continue to runeven if the parent process that created them terminates[ :\pp \system\processes]python fork-count py process spawned process spawned process spawned process spawned process spawned main process exiting [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = forking processes