From: Joel VanderWerf Date: 2004-02-25T03:51:17+09:00 Subject: Re: rehash segfault Yukihiro Matsumoto wrote: > Hi, > > In message "rehash segfault" > on 04/02/25, Nathaniel Talbott writes: > > |I don't have a lot of information on this bug at this point, but > |figured I'd throw out what I do have, and see if it's enough to jog > |someone's brain. I'll of course continue to gather more information as > |I'm able and present it here. > | > |I have code that looks like this in my application: > | > | @cache = Set::new > | def @cache.rehash > | @hash.rehash > | end > > Ruby hashes are not completely thread-safe. I knew the problem > existed, but I couldn't fix it without significant slow-down. > Can you isolate cache access for each threads? Does this mean that some of the Hash methods are not atomic w.r.t. the thread scheduler? Which ones? It's understandable that if h[x] invokes the default proc, you lose atomicity. Are there any surprising cases?