[TYPO3-core] Caches and Locking

Philipp Gampe philipp.gampe at typo3.org
Sat Mar 8 21:11:41 CET 2014


Hi Markus,

Markus Klein wrote:

> That's the first pitfall. File creation, time checking and all these
> operations are not atomic (as a block). Hence there's always a way to get
> this to a race condition. (Actually this is the problem of the 'simple'
> locking of the Locker class currently.)

IMHO this variant could be extended by write a random (or otherwise process 
unique) string into the file, waiting a bit and reading it again. The last 
writer wins here.

Are there any know issues with the 'x' flag for opening the file handle?
Otherwise this simple lock method looks pretty good already.

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