On Tuesday, August 13, 2019 9:51 PM, Philip McGrath <phi...@philipmcgrath.com> 
wrote:

> The relevant chapter of the reference is "Concurrency and Parallelism" 
> (https://docs.racket-lang.org/reference/threads.html):
>
>> All constant-time procedures and operations provided by Racket are 
>> thread-safe because they are atomic. For example, 
>> [set!](https://docs.racket-lang.org/reference/set_.html#%28form._%28%28quote._~23~25kernel%29._set%21%29%29)
>>  assigns to a variable as an atomic action with respect to all threads, so 
>> that no thread can see a “half-assigned” variable. Similarly, 
>> [vector-set!](https://docs.racket-lang.org/reference/vectors.html#%28def._%28%28quote._~23~25kernel%29._vector-set%21%29%29)
>>  assigns to a vector atomically. The 
>> [hash-set!](https://docs.racket-lang.org/reference/hashtables.html#%28def._%28%28quote._~23~25kernel%29._hash-set%21%29%29)
>>  procedure is not atomic, but the table is protected by a lock; see [Hash 
>> Tables](https://docs.racket-lang.org/reference/hashtables.html) for more 
>> information.

How can I tell a procedure is constant-time?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/fYyFPs18UuvupCnh5ZbEQlifGf7tM-YpUXH6iI9dviT1fnqf-hyOcp1HtdDxcFJepBFddSG2_A5pC7SAtyfQhrGhn2VjncqtSgVD8qNeQiQ%3D%40protonmail.com.

Reply via email to