Re: Re: how do you get to do multiple mysql queries concurrently?
| From: | Per Jessen | Date: | Fri, 01 Feb 2008 10:38:07 +0000 |
| Subject: | Re: Re: how do you get to do multiple mysql queries concurrently? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268526@lists.php.net to get a copy of this message | ||
Richard Lynch wrote:
>> I think you are mis-remembering, yes. When your fork() call returns,
>> you have two separate processes, your child process being an exact
>> copy of your parent process. (mostly, see "copy-on-write"). The only
>> thing they share at this point are open file descriptors which have
>> also been copied, so they obviously point the the same file(s).
>
> So they could easily corrupt the file by making assumptions about it.
Actually only if they make incorrect assumptions :-)
> More importantly, if you build and initialize some data structures
> before you fork, and if they each assume they have exclusive access to
> said data structures, your program ends up not being "thread-safe"
I'm sorry, you're wrong. You don't seem to quite understand what fork()
does. After the fork(), both processes will each have a copy of those
data structures, and they can both do whatever they like to them
without interfering with each other.
Anyway, enough of this. I'm done.
/Per Jessen, Zürich