mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-devel] hash-table/modify!


From: Joe Marshall
Subject: Re: [MIT-Scheme-devel] hash-table/modify!
Date: Sun, 20 Dec 2009 00:30:22 -0800

On Sat, Dec 19, 2009 at 11:53 PM, Taylor R Campbell <address@hidden> wrote:
>   Date: Sat, 19 Dec 2009 23:48:12 -0800
>   From: Joe Marshall <address@hidden>
>
>   You need to avoid a race between two processes trying to modify
>   the cell at the same time.
>
> None of the hash table implementation is safe for concurrent update.
> It is protected only against interruption during updates.  If you want
> to make concurrent updates to a hash table safe, you must synchronize
> them yourself, for instance with a mutex.

What would happen if the modifier procedure added or deleted an element
from the table?  I'm thinking about the case where we've found the cell
pointing at the entry, but the modifier code causes a rehash and the
bucket links are rethreaded while we're trying to walk them.

-- 
~jrm




reply via email to

[Prev in Thread] Current Thread [Next in Thread]