"Pat A" <pw*******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Are global variables thread safe? We are seeing competing threads
modifying global variables on calls to the same page. We are running in
ISAPI mode. Are globals protected internally inside of the PHP runtime
with a semaphore or some other mechanism?
Yes. They managed, along with all internal data, by TSRM, the PHP
thread-safe resource manager. Based on the id of current thread, a block of
memory is obtained/allocated by TSRM. The thread data registry itself is
protected by a mutex.
The behavior you described is rather odd. As far as I know, there is no
thread-unsafe version of the PHP engine for Windows.
Can you show us some code sample?