lhfei / hibernate-memcached

Automatically exported from code.google.com/p/hibernate-memcached
0 stars 0 forks source link

Use getMulti with dogpile prevention #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
From a conversation with JasonB

> > I believe that the dogpile protection could be helpful, but I see that
> > it requires 2 requests to the servers. Could this be sped up with a
> > get_multi? How much overhead does it tend to add?
>
> I'm not sure where I'd be able to use multi_get in there, did you have
> a suggestion there? I'm not totally convinced that the dogpile stuff
> is implemented in the best way. It works, but it could be better.

My thought was, in memcacheGet(), you could retrieve the dogpile token
and the actual object in parallel. If the dogpile token is null, just
ignore the object return. If the dogpile token is valid, you already
have your return value.

Original issue reported on code.google.com by raykrue...@gmail.com on 5 Jun 2009 at 2:26

GoogleCodeExporter commented 8 years ago
I've added the getMulti support. It required adding a new method to the Memcache
interface which may make it difficult for anyone who has their own custom impl. 
I
doubt there's too many folks doing that though.

Original comment by raykrue...@gmail.com on 15 Jul 2009 at 3:59

GoogleCodeExporter commented 8 years ago

Original comment by raykrue...@gmail.com on 15 Jul 2009 at 4:51