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 Sat, January 26, 2008 3:32 am, Per Jessen wrote:
> Richard Lynch wrote:
>
>> Process forking has EVERYTHING to do with thread safety.
>> Whatever is going to go wrong in a threaded environment is going to
>> also go wrong when you fork the process, almost for sure.
>
> Forking a process and creating a thread are really two very different
> concepts (from a programming pov).
>
> In a threaded environment you often have e.g. semaphores and mutexes
> to
> coordinate access to shared data.  When you've forked a process, you
> share data over IPC or similar.
> When you create a new thread, it has access to global scope variables
> in
> the main tread.  It has access to shared heap storage.  None of this
> applies to a forked process.

That all depends on which implementation of threading you are using...

And, ultimately, if the program wasn't written correctly to handle
being forked/threaded it's gonna crash...

Whether it's two "threads" or two "processes" trying to utilize the
same resource as it they had exclusive access when they don't, you end
up in the same position...

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