138 reputation
4
bio website
location
age
visits member for 2 years, 3 months
seen Oct 1 '12 at 4:08

Aug
21
awarded  Popular Question
May
27
comment Atomic Memcache Operations in PHP
That did it! The solution that worked was a combo if this answer, plus Izkata's comment. I give the lock key a random value between 1 and 1,000,000,000. Then, right after setting it, I check it's value. If the values do not match, I return false. This has turned my 90% solution into a 100% solution. Of course I leave a 1% margin of error, but it seems like that would be an extremely rare case. Granted my test used 10 simultaneous connections. Perhaps a higher number may return different results.
May
27
awarded  Scholar
May
27
accepted Atomic Memcache Operations in PHP
May
26
comment Atomic Memcache Operations in PHP
Thanks! I gave it a shot. Although it is cleaner, it still fails my test (10 connections executed at the same time, trying to access the same key, and modify it, then save it) :(
May
26
awarded  Supporter
May
25
awarded  Student
May
25
asked Atomic Memcache Operations in PHP