On 02.06.2008 13:35, Adam Klobukowski wrote:
Hello

I'm writing a PHP extension where I'm using a custom library. This library uses a structure that needs to be initialized once per server instance. First I initialized it in each of my functions and deinitialize it ant the end. It works ok, but unfortunetly it turns to be to slow. So, I'm trying to do it globally. Everything in that library is internally synchronized, so I don not have to worry about thread safety. I declare my structure globally (in fact a pointer to a structure), initialize it in PHP_MINIT (it works), then deinitialize in PHP_MSHUTDOWN (works too).

That's exactly what lots of extensions do.

Unfortunetly, when I'm trying to use this structure in my PHP_FUNCTIONs, it does not work.

You've managed to describe everything except for the problem itself =)
What does this "does not work" mean?
How exactly do you initialize and address these variables?

Btw. I'm looking for a good reference of internal PHP APIs. I found excelent Sara's Golemon articles, but thats all, is there anything better?

The sources are better.

--
Wbr, Antony Dovgal

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to