Setup pcntl_fork() for multiple include files

Closed

[url removed, login to view]

threads = 0;

}

// dispatch a new thread

function dispatch($file)

{

$this->threads++;

// start new thread

$pid = pcntl_fork();

if($pid == -1) // fork failed

{

return false;

}

elseif ($pid > 0) // parent

{

return true;

}

else // child

{

// include requested file

include($file);

exit;

}

}

// wait for all threads to finish

function wait(&$status = null)

{

//wait for each thread to finish

for ($i=0; $i threads; $i++)

{

pcntl_wait($status);

}

}

}

?>

dispatch("[url removed, login to view]");

$async->dispatch("[url removed, login to view]");

$async->dispatch("[url removed, login to view]");

$async->wait();

?>

This Code print Results in Page.

But i want all output in $string after closing all functions and classes.

Page : a,b,[url removed, login to view] ( Normal CURL requests.

$markup="something"; echo $markup;

Requirements :

1 : php parallel processing

2 : get all output in string at end of code..

3 : Show output only when we want to use. means ( echo $string; ) .

3 : speed improvements (don't make it heavy code).

Skills: PHP

See more: string processing in c, async, php curl http code, setup finish, php speed improvements, thread curl, php elseif, async return, php echo print, curl thread, php thread function, php exit child, string processing, echo file php, php echo file, php wait function, parallel processing, curl net, code pid, php pcntl_fork, curl async, pcntl_fork, net async http requests, php setup, function thread

About the Employer:
( 0 reviews ) malout, India

Project ID: #4262752

3 freelancers are bidding on average $37 for this job

genkov

That's not possible without shmop or some other IPC, like a simple temporary SQLite db or better yet flatfile-based IPC and aggregation. Bid is for consulting and support only. Contact me for more information.

$30 USD in 3 days
(19 Reviews)
5.7
linuxfreak1985

Hi there, We are experts in PHP Open Source (any kind of PHP/MySQL work),wordpress and Ajax/Web 2.0 technology. Some of the projects we completed for php are mentioned below https://www.freelancer.com/projects/ More

$30 USD in 10 days
(56 Reviews)
5.7
aczireonline

Hi, Will get this done. I do have multithreading experience with PHP and I know how to pass data between forked clients and server. Please contact asap.

$50 USD in 1 day
(35 Reviews)
4.9