[swift-users] Recommendation for thread-safe dictionary

Dmitri Gribenko gribozavr at gmail.com
Thu Dec 10 12:17:27 CST 2015


On Thu, Dec 10, 2015 at 10:06 AM, Pelaia II, Tom <pelaiata at ornl.gov> wrote:
> But isn’t that really a problem with that use case rather than the
> concurrent dictionary itself? There are a lot of bad things one can do with
> almost any code. For example, one can naively use the standard library
> dictionary in subtle, unsafe ways with concurrency and get into trouble.

The concurrency considerations and safety conditions for Dictionary
are the same as for Int, so I don't think there is anything subtle
here.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-users mailing list