Changes between Initial Version and Version 1 of ReadonlyProtection


Ignore:
Timestamp:
2006-08-27T04:40:53Z (13 years ago)
Author:
moo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ReadonlyProtection

    v1 v1  
     1= Readonly Protection =
     2
     3Readonly Protection is a mechanism used in XCache to make it more stable. It is implemented by mmap'ing twice on same memory, 1 for read/write(rw) and the other for readonly(ro). XCache store data into rw cache, and fix the pointers up to ro cache, so all access if read from the ro memory.
     4
     5The cache can be currupted by accident, e.g., if some pointer isn't handled when copy from cache, some php/extension may write to the cache by this pointer currupting the cache. The cache with readonly permission won't allow this happen.
     6
     7Does it ever help? Yes, it helped when i was developing XCache, figuring out bugs between XCache and php core.
     8
     9You can grant performance by shadow-copying some data, i.e.: some of the data can be accessed by the php executor in cache directly, without copying them to emalloc'ed memory, but only when these requirement meet:
     10 * the executor read the data, but never write it
     11 * the executor never efree() the pointer already, or you can trick it so.
     12This is true, however, with readonly protection disabled only.