2
再见 Golang, 你好 Rust
source link: https://www.v2ex.com/t/1037766
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
再见 Golang, 你好 Rust
原因: 不想考虑数据竞争的问题了, 因为人永远考虑不周全, 所以让机器处理才是合理的
15 条回复 • 2024-05-05 22:18:19 +08:00
thinkm 12 小时 46 分钟前 不用 Golang 的人,注定只能度过一个相对失败的人生
|
williamshan 12 小时 37 分钟前 via Android @thinkm 怎么讲
|
sherlockwhite 12 小时 19 分钟前 有什么数据竞争的实例吗
|
sherlockwhite 12 小时 18 分钟前 想不通从一个相对简单的语言转到一个复杂的语言就是因为数据竞争,不太懂是什么逻辑
|
march1993 12 小时 7 分钟前 让机器处理太简单了,所有数据加个锁就完事儿了,但是这样做性能太差了。golang 的套路是让你通过 chan 去通信、同步,而不是靠 sync.*。并且 rust 也没有在语法层面提供同步的办法啊。
|
chaleaochexist 10 小时 41 分钟前 这种帖子吧。。。 就是收币的, 得,5 铜币奉上, 不谢!
|
minami 10 小时 32 分钟前 这么不喜欢锁怎么不去写单线程的 js ,是不喜欢吗
|
smallboy19991231 10 小时 13 分钟前 @williamshan 有句原話是 不用 Mac 的人,注定只能度过一个相对失败的人生
|
standchan 7 小时 51 分钟前 用 chan 去通信,而不是传统的锁。
|
xwhxbg 7 小时 14 分钟前 1 冷知识,chan 内部自带一个锁
|
lsk569937453 6 小时 56 分钟前 @proxyai
rust 不是银弹。 我在用 rust 实现 redis 的过程中对比了 mpsc::channel 和 Arc::Mutex 的性能。 单线程下,两者性能差不多的。 多线程下,全局 Arc::Mutex 对数据加锁的性能还比 mpsc::channel(多生产者单消费者)好一点 https://github.com/lsk569937453/rcache/tree/main:全局锁 https://github.com/lsk569937453/rcache/tree/0.0.1:mpsc::channel 实现的多生产者单消费者模型 |
ShuWei 1 小时 54 分钟前 你确定自己能受得了 rust 的折磨?
|
fregie 1 小时 18 分钟前 这有什么好选的,本身就是为了不同场景而设计的不同语言,在不同领域各有优势
|
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK