At Fri, 22 Mar 2019 12:13:13 -0700 (PDT), zeRusski wrote:
> So, the `foo-struct-set!` would be atomic, but (hash-set! 
> (foo-struct-field-with-table foo) key value) would not (assuming a mutable 
> hash-table value there), correct?

Hash tables can be safely updated by `hash-set!` even when they are
used by multiple threads, but with the caveat that `hash-set!` is not
kill-safe for `equal?`-based tables. Not being "kill-safe" means that
an `equal?` hash table can get stuck in locked state if you kill a
thread that is in the middle of a `hash-set!` or `hash-ref`. (Hash
table update and reference is kill-safe for `eq?`- and `eqv?`-based
hash tables.)

Hash table operations like `hash-map` are not atomic with respect to
hash-table updates, but there are still some weak guarantees. See the
docs for more information.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to