Re: [APC-DEV] atomaticity/thread safeness of apc shared memory functions + mutexes

From: Date: Wed, 24 Dec 2008 23:26:50 +0000
Subject: Re: [APC-DEV] atomaticity/thread safeness of apc shared memory functions + mutexes
References: 1  Groups: php.apc.dev 
Request: Send a blank email to php-apc-dev+get-174@lists.php.net to get a copy of this message
Exception e wrote: > Couldn't find it in the docs, so I hope you know it: > > Are the userland apc cache functions (apc_add, apc_fetch, apc_delete > etc) *thread-safe/atomic*? > > > Also: I need to ensure that conncurrent access to shared memory doesn't > get me in race conditions. Wouldn't it be nice if apc could offer mutex > functions and the like? There is a semaphore extension for php, but it > is *nix-only according to the docs. The need for synchronization > mechanisms arise almost allways when using shared memory. Yes, they are atomic and they are locked appropriately. You don't need any sort of mutex. This is shared memory. Generally we don't suggest running PHP in any sort of threaded environment though. -Rasmus

« previous php.apc.dev (#174) next »