note 69198 added to function.pcntl-fork

From: Date: Sat, 26 Aug 2006 16:59:53 +0000
Subject: note 69198 added to function.pcntl-fork
Groups: php.notes 
Request: Send a blank email to php-notes+get-116365@lists.php.net to get a copy of this message
I think this simple code can help understand how fork works: <? echo "posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n"; $pid = pcntl_fork(); if ($pid == -1) die("could not fork"); if ($pid) { echo "pid=".$pid.", posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n"; } else { echo "pid=".$pid.", posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n"; } ?> ---- Server IP: 66.163.161.117 Probable Submitter: 222.94.2.43 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.pcntl-fork.php Edit -- https://master.php.net/note/edit/69198 Del: integrated -- https://master.php.net/note/delete/69198/integrated Del: useless -- https://master.php.net/note/delete/69198/useless Del: bad code -- https://master.php.net/note/delete/69198/bad+code Del: spam -- https://master.php.net/note/delete/69198/spam Del: non-english -- https://master.php.net/note/delete/69198/non-english Del: in docs -- https://master.php.net/note/delete/69198/in+docs Del: other reasons-- https://master.php.net/note/delete/69198 Reject -- https://master.php.net/note/reject/69198 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116365) next »