V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  rachelross  ›  全部回复第 1 页 / 共 1 页
回复总数  3
@wph95 Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. 从以上官方文档中, 我理解 "goroutine 是 Go 并行设计的核心" 这句话就是错误, 至少是误导. maybe, 我还太菜了, 我实在难以理解.
@nekoyaki 原文如下: goroutine 是 Go 并行设计的核心。goroutine 说到底其实就是协程,但是它比线程更小,十几个 goroutine 可能体现在底层就是五六个线程,Go 语言内部帮你实现了这些 goroutine 之间的内存共享。执行 goroutine 只需极少的栈内存(大概是 4~5KB),当然会根据相应的数据伸缩。也正因为如此,可同时运行成千上万个并发任务。goroutine 比 thread 更易用、更高效、更轻便。
@orangeade 嗯嗯, 多谢指点
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1342 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 23:37 · PVG 07:37 · LAX 16:37 · JFK 19:37
Developed with CodeLauncher
♥ Do have faith in what you're doing.