| | |
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 |
advanced apache api array beginner binary broken cakephp check checkbox class cms code cookies cron curl database date datepart display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google head href htaccess html if...loop image include includingmysecondfileinthechain insert ip javascript job joomla jquery key library limit link login mail menu mlm multiple mysql oop password paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search server sessions smarty sms sorting source space sql startup stored syntax system table traffic tutorial unicode update upload url validator variable video web youtube zend






