我需要在多个Go协程写入通道时进行锁定吗?

huangapple go评论81阅读模式
英文:

Do I have to lock when several go routines write in channel

问题

我必须锁定吗,如果两个Go协程写入同一个通道,或者这是由Go自动处理的?

英文:

Do I have to lock if two go routines write into the same channel or is this automatically handled by go?

答案1

得分: 5

通道是安全的,它是内置的。

英文:

Channels are safe, it's built in.

huangapple
  • 本文由 发表于 2012年9月7日 17:40:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/12315587.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定