To be able to implmenet interface of object-oriented database to PHP I need
to
have object cache which will map persistent object identifier (OPID) to
loaded instance of the object. This cache should be "weak", i.e. it should
not prevent garbage collection from deallocating unused instances of
peristent object (otherwise all database will be soon loaded in memory)..

As far as I understand, PHP uses GC bases on refernce couters. Also I do not
find something like weak reference in language manual. There are two other
ways how to solve the problem
without weak references:
1. Be able to check valye of reference counter (so I can check the it is
equal to 1 and if so remove this object from object cache)
2. Be able to detect the moment when object is removed by GC (in this case I
can make object cache invisible for GC and when object is deleted, it will
be also unlinked frmo object cache).

Can anybody tell me if such features are available in PHP (I failed to find
them myself).
Or may be there is some other way to solve the problem?

Thanks in advance
Konstantin



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

Reply via email to