为什么无锁并发这么大的事情(在Clojure中)? [英] Why is lockless concurrency such a big deal (in Clojure)?

查看:187
本文介绍了为什么无锁并发这么大的事情(在Clojure中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被告知Clojure有无锁并发,这是重要的。

I'm told that Clojure has lockless concurrency and that this is Important.

我使用了一些语言,但没有意识到他们正在执行锁

I've used a number of languages but didn't realize they were performing locks behind the scenes.

为什么这是Clojure(或任何具有此功能的语言)的优势?

Why is this an advantage in Clojure (or in any language that has this feature)?

推荐答案

我不能具体谈论Clojure,但...这意味着你不需要等待某人完成某些事情,然后才能开始工作。这是伟大的。

I can't speak about Clojure specifically, but ... it means you don't need to wait for someone to be done with something before you can get to work. Which is great.

通常它是用不可变类型实现的。如果没有什么可以修改,你真的不需要等到有人完成它,然后才能访问它。

Typically it's achieved with immutable types. If nothing can be modified, you don't really need to wait till someone else is done with it before you can access it.

这篇关于为什么无锁并发这么大的事情(在Clojure中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆