[TYPO3-core] Caches and Locking

Philipp Gampe philipp.gampe at typo3.org
Sat Mar 8 20:54:15 CET 2014


Hi Markus,

Markus Klein wrote:

> Yes, a semaphore can be initialized to a certain number. Each call to
> sem_acquire will decrement it then. By default it is initialized to 1, so
> it works as a mutex. But this is not what we need here. We can have
> unlimited parallel read access to the caches. We actually just need to
> know, which process is the first to read, who will lock the write mutex,
> and which is the last process being done with the read, unlocking the
> write mutex. (this is for the first readers-writers problem)

Yes, but do we need to care about readers? IMHO it would be sufficient to 
get a write lock and rereading the files contents before modifying the data.
Readers could skip the lock if they cannot acquire it.

Best regards
-- 
Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln
Documentation – Active contributor TYPO3 CMS
TYPO3 .... inspiring people to share!



More information about the TYPO3-team-core mailing list