Re: Re: how dod you get to do multiple mysql queries concurrently?
| From: | Jochem Maas | Date: | Fri, 25 Jan 2008 19:45:55 +0000 |
| Subject: | Re: Re: how dod you get to do multiple mysql queries concurrently? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268132@lists.php.net to get a copy of this message | ||
Richard Lynch schreef:
On Fri, January 25, 2008 11:33 am, Floor Terra wrote:I agree about the don't do that part - but what has process forking got to do with thread safety? AFAIK you shouldn't do that because it madness to fork a complete apache process.Do *NOT* do this in a web-server environment, unless you have EXTENSIVELY and EXHAUSTIVELY tested all your PHP extensions for thread-safety!Try pcntl_fork() to create a child process for each query. Each child can make it's own MySQL connection.No, just the mysql queries.I know how to do multiple queries - the key issue in my question was how to do them concurrently (i.e. in parallel).So you want to make PHP multithreaded???
http://php.net/pcntl_fork just plain says "Don't do that." for a reason...