| | |
How to pass information to child processes
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
My problem is that I have a PHP application that needs to (in Windowsese) multi-task. I am relatively new to PHP and equally new to Linux. I need to know how to pass information from a parent process to a child process and vice versa. If somebody could please provide an example, it would be very much appreciated.
Hoppy
Hoppy
•
•
•
•
My problem is that I have a PHP application that needs to (in Windowsese) multi-task. I am relatively new to PHP and equally new to Linux. I need to know how to pass information from a parent process to a child process and vice versa. If somebody could please provide an example, it would be very much appreciated.
Hoppy
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
My question is not the least bit vague. It is perfectly clear. Let's say, for example, that I had a parent process whose job it was to read a file containing URLs. And that each child process was supposed to read the contents of a given URL and save it to a disc file.
In this case, I would want the parent to create a child for each URL and pass the URL to the child which would in turn read its contents and store it in a file on disc. Perhaps, the child would return to the parent, the name of the file in which the contents of the URL are saved.
What I am looking for is the PHP mechanism by which the URL can be passed to the child and the name of the file in which the contents of the URL is stored can be returned to the parent.
Something like SendData($parentid, $childid, &dataaddress, datalen);
Is that any clearer?
Hoppy
In this case, I would want the parent to create a child for each URL and pass the URL to the child which would in turn read its contents and store it in a file on disc. Perhaps, the child would return to the parent, the name of the file in which the contents of the URL are saved.
What I am looking for is the PHP mechanism by which the URL can be passed to the child and the name of the file in which the contents of the URL is stored can be returned to the parent.
Something like SendData($parentid, $childid, &dataaddress, datalen);
Is that any clearer?
Hoppy
The only current way to do anything of that sort is on execution of a child process with http://us.php.net/manual/en/function.pcntl-exec.php
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
I read the URL you provided and especially the user contributed notes that followed. It appears to me that the folks that designed the process control portion of PHP (pcntl) were rank amateurs with little real world experience.
Using pcntl_exec after forking really misses the mark. It has no way to pass anything back to the parent, not even a return code.
Using pcntl_exec after forking really misses the mark. It has no way to pass anything back to the parent, not even a return code.
•
•
•
•
I read the URL you provided and especially the user contributed notes that followed. It appears to me that the folks that designed the process control portion of PHP (pcntl) were rank amateurs with little real world experience.
Using pcntl_exec after forking really misses the mark. It has no way to pass anything back to the parent, not even a return code.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
•
•
I read the URL you provided and especially the user contributed notes that followed. It appears to me that the folks that designed the process control portion of PHP (pcntl) were rank amateurs with little real world experience.
Using pcntl_exec after forking really misses the mark. It has no way to pass anything back to the parent, not even a return code.
http://pleac.sourceforge.net/pleac_p...gementetc.html
http://www.php.net/proc_open
http://www.php.net/socket_create_pair
http://www.php.net/sem
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Other Threads in the PHP Forum
- Previous Thread: Connection problem
- Next Thread: checkbox array storage and retrieval
| Thread Tools | Search this Thread |
ajax apache api array back basic beginner binary broken cakephp checkbox class cms code computing cron curl database date delete display dynamic echo email error external file files filter folder form forms function functions gc_maxlifetime google host href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm multiple mysql navigation oop parsing paypal pdf php problem query question radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validation validator variable video web xml youtube






