Re: Multithreading for OOP PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> It's just as we sometimes use PHP for doing some big Server works (e.g. database copying or something) and
> it would be nice to controll by yourself which Thread (or process) does which part of the job.
>

I don't suppose that the client is sitting there waiting for a reply
until the browser times out while the code is database copying or
something. That is why you should hand off the database copying to an
application that does that and then return to the client a response
quickly.
exec("mysqldump");

You could even give the client and AJAX page and inform them of the
status of the operation if the application that you passed off the
work to supports it.

I have wished for PHP threading many times, and my current "big
client" also asked for PHP threading recently. Yet, every single time
that I've devised an alternative solution I was glad that I did. PHP
is not memory efficient and we really don't need it hogging up the CPU
when a real C program can do the intensive work. And if you need
threading, then you are very likely looking at exactly the type of
workload that PHP is designed not to do!

--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux