Re: Re: how do you get to do multiple mysql queries concurrently?

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

 



On Mon, January 28, 2008 2:52 pm, Per Jessen wrote:
> True again. However, I was commenting on your assertion that "Process
> forking has EVERYTHING to do with thread safety", which I will stay is
> wrong.  When you fork another process, you don't need to worry about
> whether your code is thread-safe or not. You don't have to be
> reentrant, you could even use self-modifying code if you felt the
> urge.

Perhaps I mis-remember my C days, but I'm pretty sure it's trivial to
write a "fork" program in which both parent and child attempt to
utilize the same "global" resource as if they have exclusive access
and crash your program.

Sure smells like a thread-safety issue to this naive reader...

fork() manages to "do the right thing" for many common resources, but
it doesn't handle all of them.

If you expect to have two processes running the same lines of codes at
once, you need to worry about thread safety just as if there were
"real" threads involved.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
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