[elephant-devel] Cached slots and other tweaks for 1.0

Ian Eslick eslick at media.mit.edu
Mon May 12 15:23:53 UTC 2008


On May 12, 2008, at 10:23 AM, Leslie P. Polzer wrote:

>
>> - Currently cached slots are not rolled back to their initial value  
>> if
>> transaction aborts.  I can add a facility to push the cached value on
>> the initial read into a per-transaction list that can be used to  
>> reset
>> the cached slots on an abort.
>
> Would it be possible to automatically restore the cached slots
> on a failed transaction? This would be the most transparent
> behaviour IMHO.

I think I've all but decided to take this approach.

>
>> - Currently there is no way to 'refresh' the instance to get data  
>> from
>> the db or to force reads to go to the db instead of the cached value.
>> Any suggestions on a model & interface for doing this?
>
> Hm, what's the use case for this, assuming that the cache works
> correctly?

A database shared among lisp images.  The cached copy of the object  
may become stale.

Also, cached slots are not currently thread safe.  If you don't  
guarantee that only one thread at a time is working on a particular  
object, you can get problems.  These slot values are not isolated by  
the transaction mechanism.  I'm not sure we should solve that; the  
protection for cached slots should be at a higher level so it doesn't  
swamp the benefits.

For example you can have a transient slot with a lock on it if you  
don't have too many of these objects, or a protected hash table...   
This might occur if there are two parallel sessions under the same  
user-id.

Ian

>
>> 4) the my-config.sexp file is not created by default, should we add  
>> an
>> option to
>>    auto-create it either as a restart option or just by warning that
>> one was created?
>
> It depends. IME the current config.sexp is mainly a thing for the
> BDB backend, so it's pretty useless for other backend users.

True, unless you use it to add clsql library files or choose a  
compilation option for
the memutil library.

> I'm all for auto-creating and warning.

Sounds good.

>  Leslie
>
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel




More information about the elephant-devel mailing list