NYCPHP Meetup

[nycphp-talk] thread-safety analysis...

Vugranam Sreedhar vugranam at us.ibm.com
Sun Oct 22 07:35:11 EDT 2006


Thanks for the nice explanation... Would PHP ever become multithreaded...
Since Apache 2+ will continue to course of multithreading I am
sure PHP will eventually have to catch up the multithreading direction...



With regards,

Sreedhar

-------------------------------------------------------------------------------------------------------------------

Research Staff Member
TJ Watson Research Center
T/L 863-7325
Ext: 914-784-7325



                                                                           
             Paul Houle                                                    
             <paul at devonianfar                                             
             m.com>                                                     To 
             Sent by:                  NYPHP Talk <talk at lists.nyphp.org>   
             talk-bounces at list                                          cc 
             s.nyphp.org                                                   
                                                                   Subject 
                                       Re: [nycphp-talk] thread-safety      
             10/21/2006 10:29          analysis...                         
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
                NYPHP Talk                                                 
             <talk at lists.nyphp                                             
                   .org>                                                   
                                                                           
                                                                           




Hans Zaunere wrote:
> The problem really is not thread safe code written in the PHP language,
but
> rather the environment in which PHP runs in.  Now PHP can be compiled for
> thread safety (TSRM, for instance http://us2.php.net/tsrm).  However,
> because PHP is often linked against so many external libraries
> (gd/jpeg/xml/etc) it cannot be considered safe to execute in a threaded
> environment.  This is the real problem and one of PHP's greatest
strengths
> and unfortunate faults.
>
    This is also a problem for Perl,  Python and many other languages
which are advertised as thread-safe.  Java runtimes are threadsafe
because of a general xenophobia:  the Java runtimes link in a limited
number of C libraries,  and Java programmers don't really believe in
linking in C libraries...  Though I have to admit that I've had good
luck linking Java to Fortran.

    Lacking threads,  the big disadvantage of PHP is that it consumes
more memory.  Data structures need to be replicated for each copy of
PHP.  That said,  RAM is getting cheaper,  and PHP is parsimonious in
it's memory use,  so most of us do just fine running PHP in processes
instead of threads.
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php





More information about the talk mailing list