[TYPO3-dev] Idea: use shared memory as cache

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Sep 12 10:23:53 CEST 2007


Hi!

The Core reads some small values like configured domains from the DB 
(sys_domain) and from the disk. This values could be put in a cache. I 
think that a file cache with serialized data will improve things, but why 
not go further and use the memory for it?

So I propose to create a caching system that is based on the shmop_* 
functions ("Shared Memory Functions").

Note that these functions need a locking mechanism to avoid concrrent 
writes. A logical approach would be to use the sem_* functions ("Semaphore, 
Shared Memory and IPC Functions") but these are not available on Windows. 
So we need either a fallback to eg file based locking. I think that it's 
safe to use the very first byte of the shared memory segment as a 
semaphore. Writing only one byte should be atomic.

Comments?

Masi




More information about the TYPO3-dev mailing list