PHP APC - how are concurrent apc_store requests handled?

php-newbie
php-newbie used Ask the Experts™
on
Hi,

I'm planning to use PHP APC and was wondering how concurrent apc_store requests are handled? So what happens if two processes try to store different values into the same variable?
Will it produce an error for one of the processes or will is wait until one of the process finishes?

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007

Commented:
the process which writes last to the cache/shared memory will override the previos data in the cache. There will be no error and no wait.

Author

Commented:
But what if two processes try to write the cache variable at exactly the same time?
Top Expert 2007
Commented:
The process with the last CPU cycle which execute the memcopy instructions wins.
The chance that two processes will be execute the memcopy instruction at the same CPU-cycle is about 1/GHZ of processor.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial