Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
1 5
Newest
 Editor
Impact
~3k people reached

  • 0 posts edited
  • 0 helpful flags
  • 3 votes cast
May
6
awarded  Editor
Dec
26
awarded  Notable Question
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