Deletes Are Driving Me Crazy
Matthew Glubb
matt at zgroupplc.com
Mon Jan 16 12:14:31 UTC 2006
Hi Sean,
Thanks a lot for the reply. Do you have a version of the code with
those changes? My C is non-existent at best :/
Regards,
Matt
On 15 Jan 2006, at 04:33, Sean Chittenden wrote:
>>> I simply wish to be able to delete a key that has a zero expiry
>>> period and then immediately be able to add a key of the same name.
>>> The reason that I cannot use set is because if it already exists in
>>> the cache I do not want to replace the value.
>>>
>>
>> I have a somewhat similar requirement, but I'm curious about this
>> specific
>> approach. It sounds as if an object may go into the cache with a
>> given key,
>> but in some scenarios if that key is already in use, that object
>> would use a
>> different key in the cache. Is that accurate?
>
> The best solution for this is to replace the delete time counter
> with a
> timeval struct and then use gettimeofday(2) instead of time(3).
> Using a time_t
> gives you whole second resolution, but gettimeofday(2) gives you
> microsecond
> resolution on your delete's, but it works well enough for the times
> when I've
> had this problem in the past. *shrug* YMMV -sc
>
> --
> Sean Chittenden
m a t t h e w g l u b b
________________________________________________________________________
Z Group PLC
Tel: +44 (0) 8700 111 173
Fax: +44 (0) 8707 051 393
Txt: +44 (0) 7800 140 877
Web: <http://www.zgroupplc.com/>
PLEASE NOTE ZGROUP IS NOT LIABLE FOR ANY DAMAGES, MALFUNCTION, OR LOSS
OF DATA, CAUSED AS A RESULT OF FOLLOWING ANY ADVICE ENCLOSED IN THIS
EMAIL. ANY CHANGES SHOULD BE CARRIED OUT AT YOUR OWN RISK.
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. The opinions expressed in this mail are those of the author
and do not necessarily represent the views of the company. If you have
received this email in error please notify <service at zgroupplc.com>
More information about the memcached
mailing list