|
Posted by Andy Hassall on 01/27/07 11:43
On Sat, 27 Jan 2007 09:50:01 +0100, "_mario.lat" <_mario.lat@libero.it> wrote:
>I'd like to fork a process so I have 2 process: process A and process B.
>How can send A a message (array of values or a value) to B?
>how can B read the message?
If you are actually forking (as opposed to exec'ing a new process), then
forked processes share filehandles with their parent, so that's one way to
communicate between them. Other methods may include:
Simple command line parameters? http://php.net/system
Pass data via stdin/stdout? http://php.net/proc_open
Sockets? (UNIX, TCP, etc.) http://php.net/sockets
Or see http://en.wikipedia.org/wiki/Inter-process_communication for more.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|