I have a C++ based php-extension accessing a C++ based non-php .so data
engine, which reads and writes using the open/read/write/close calls in
fcntl.h.
The non-php engine is reliable away from php, but when accessed via the
php extension, it works, but runs into two forms of errors:
a) seek/read/write errors - one moment it reads fine, the next it fails.
b) data corruption/variable switching - looks like variables are getting
confused as to their appropriate value, which smacks of a threading issue.
Regarding a) streams:
Must any file access either in an extension directly, or in a library or .so
object called by that extension, use php streams, to be safe? Or is there
a way to allow them to use native system calls, without the strange errors?
Regarding b) threads:
Is there a useful reference as to the threading model in zend/php, and/or
its relation to the apache threading model?
Cheers,
Andrew.