By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,631 Members | 1,592 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,631 IT Pros & Developers. It's quick & easy.

how send messages between two proceses?

P: n/a
hallo,
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?
Thank you in advance for the time you'll spend for me.
Mario.

Jan 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sat, 27 Jan 2007 09:50:01 +0100, "_mario.lat" <_m********@libero.itwrote:
>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-p..._communication for more.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 27 '07 #2

P: n/a
_mario.lat 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?
Unix sockets, TCP, UDP, shared memory.
how can B read the message?
By listening on a socket (Unix sockets, TCP, UDP) or by continuous polling
(shared memory).

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jan 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.