[Haskell-cafe] ANN: io-memoize 1.1
Peter Simons
simons at cryp.to
Fri Jun 13 17:16:23 UTC 2014
Hi Dan,
> 1. Create an empty cache with newCache
> 2. fetch repeatedly from the cache, each time providing a fallback in
> case it is empty.
>
> Fetching from a Cache is thread safe: only one "fallback" will execute
> at a time, and after the first successful fallback, the cached value
> will be set and no other fallbacks will be called.
I'm not sure whether I get this correctly. If multiple threads fetch
values from one cache, will only one of those threads run at a time? Or
will those that fetch pairwise different values still run concurrently?
In other words, does the cache have a global lock or is there a lock per
value?
Best regards,
Peter
More information about the Haskell-Cafe
mailing list