Re: Re: PHP Performance in Apache: Multi-Process vs Multi-Threaded
| From: | jvlad | Date: | Thu, 16 Dec 2010 09:29:56 +0000 |
| Subject: | Re: Re: PHP Performance in Apache: Multi-Process vs Multi-Threaded | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-51039@lists.php.net to get a copy of this message | ||
> "Scott MacVicar" wrote in message:
> >
> >
> > Do you think any locking function is implemented in openssl php
> > extension?
> >
> In PHP a SSL_CTX is per thread and is not shared across other threads so
> it isn't an issue. We don't need to implement any openssl locking
> functions.
It does not matter whether you think the locking functions are needed or
not. It's matter what openssl developers think and what assumptions they did
when developed the library. As I see they expressed it pretty clear - some
globals are implicitly shared among threads and this alone may cause crashes
if locks are not used. Do you have any _strong_ reason to believe they are
wrong? They didn't say that it's SSL_CTX is the global struct that will be
implicitly shared. Even if you're correct and SSL_CTX is "the global", why
would they need 32 locks synchronizing access to it?
> An example of non-thread safe is gettext it relies on the locale which is
> per process and not per-thread.
> PHP itself at the core is thread safe. As Johannes said most common
> modules are too.
Not only yet. Do you remember dl() ? It's still here and being enabled may
cause races.
Do you think chdir won't cause races?
-j