Questions Regarding ZTS and Thread Safe-ness
| From: | Nick Knight | Date: | Sun, 04 Jun 2000 01:27:53 +0000 |
| Subject: | Questions Regarding ZTS and Thread Safe-ness | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20153@lists.php.net to get a copy of this message | ||
[NOTE - I just sent a summary of this question. Since it posted
immediately, I assume my original post of this from last week was lost.
This may provide more detail about my query. Thanks.]
I'm new to this list, but I've searched the archives and watched postings
and noone's talked (or is talking) about my topic. Not that I saw,
anyway!
I have an application that will make use of PHP 4.0 scripts in a heavily
multithreaded environment. What I want to do is encapsulize PHP in a
shared library and have my application load it and pass the scripts to it
per thread.
I was working with the 4.0 RC's, where the ZTS compiler flag was marked
"experimental". Upon getting the 4.0 release, I still see references to
"experimental".
Questions, Part 1:
Are PHP and the Zend engine currently thread-safe? Does defining the ZTS
flag create a thread-safe build of v4.0? Is using
--enable-experimental-zts still the way to turn this one? (looks like it!)
I looked at the code, and my plan was to use the php_execute_script() call
in main.c, which seems to be what the apache-module version uses. This is
where I first discovered the ZTS #define and how it affects the compiled
code. The static-structure version of the PG() and EG() macros certainly
can't be thread-safe.
Now, here's the bad part. I've tried configuring with
--enable-experimental-zts defined, and my build blows out very early with
a parameter count error in zendparse(). I see use of macros that equate
to nothing with ZTS undefined, then to paramaters when it is, so it looks
like there's an issue when defined.
So, I guess question #2 is, is anyone compiling and running in thread-safe
mode? Any pointers for me?
Thanks in advance. If there's a better place to ask these questions,
please let me know. "Dev" seemed the most appropriate place to ask.
Nick