Re: Thread-safe caches
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Tue, 06 Nov 2007 13:58:53 +0100
Alex Mizrahi wrote:
??>> the worst thing that can happen is that some cached entries are
??>> deleted by another thread, but this may be ok depending on what the
??>> cache is used for. consing can also be a problem depending on the use-
??>> cases.
PC> That would all be fine if setf were guaranteed to be an atomic
PC> operation. Unfortunately, it's not. :(
do you have an example when setf'ing single variable is not an atomic operation?
No. But there doesn't seem to be good documentation in the existing CL implementations which operations are atomic and which are not.
if it was not, implementation would be very easy to crash with simpliest operations. haven't heard anything about such cases
Maybe, but I don't want to bet on that.
Java has exceptionally good documentation about its multi-threading capabilities, and they document cases where one would guess that operations are atomic, but counter-intuitively they are in fact not. So I feel a bit uncomfortable here.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.
- References:
- Thread-safe caches
- From: Pascal Costanza
- Re: Thread-safe caches
- From: attila . lendvai
- Re: Thread-safe caches
- From: Pascal Costanza
- Re: Thread-safe caches
- From: Alex Mizrahi
- Thread-safe caches
- Prev by Date: Re: poll: how to indicate logic variables when pattern matching sexps
- Next by Date: Re: Thread-safe caches
- Previous by thread: Re: Thread-safe caches
- Next by thread: Re: Thread-safe caches
- Index(es):
Relevant Pages
|
|