I'm wondering which xcache functions are atomic. I know that xcache_inc() and xcache_dec() are both atomic. I dont know if xcache_get() and xcache_unset() are atomic.
Asked
Active
Viewed 368 times
4
Michael Berkowski
- 267,341
- 46
- 444
- 390
incognito2
- 1,024
- 3
- 13
- 20
-
What means "atomic" when you're talking about `get`? – zerkms Jul 21 '11 at 02:38
-
[definition of atomic](http://en.wikipedia.org/wiki/Linearizability) – incognito2 Jul 21 '11 at 02:40
-
I know what it means. I cannot think of "non-atomic" sample of `get`. Can you give an example when `get` could behave like it is non-atomic? – zerkms Jul 21 '11 at 02:42
-
i have no idea. I'm not a php pro or anything otherwise I would know the answer. – incognito2 Jul 21 '11 at 03:03
1 Answers
0
The Feature List says that XCache supports "atomic get/set/inc/dec".
So get is atomic, whatever that means. (It probably just means that get never returns an in-between value, which is more or less the same thing as atomic set.)
Also, since set is atomic, I see no reason why unset wouldn't be atomic, too.
kijin
- 8,702
- 2
- 26
- 32