3 ms·
Would something like golang even need lock-counting like BEAM ? I think the idiomatic way to work with golang is goroutines rather than mutex, etc. However, I'm
by sandGorgon 13y ago
Would something like golang even need lock-counting like BEAM ? I think the idiomatic way to work with golang is goroutines rather than mutex, etc. However, I'm not sure if any goroutine mailbox profiling tools are available.
- masklinn 13y ago> Would something like golang even need lock-counting like BEAM ? BEAM locks are within the VM's implementation[0]: http://www.erlang.org/doc/apps/tools/lcnt_chapter.html http://www.erlang.org/doc/apps/tools/lcnt_chapter.html. BEAM lock counting is about introspecting runtime state and capabilities. I doubt Go's runtime is lockfree. The answer would thus be "yes, most likely". > I think the idiomatic way to work with golang is goroutines rather than mutex 1. depends: http://stackoverflow.com/questions/10728863/how-to-lock-synchronize-access-to-a-variable-in-go-during-concurrent-goroutines http://stackoverflow.com/questions/10728863/how-to-lock-sync... https://code.google.com/p/go-wiki/wiki/MutexOrChannel https://code.google.com/p/go-wiki/wiki/MutexOrChannel 2. I doubt channels implementation is lock-free, though I could well be wrong [0] and maybe in NIF[1] as well [1] http://www.erlang.org/doc/tutorial/nif.html http://www.erlang.org/doc/tutorial/nif.html
- AndreasFrom 13y agoYou're right and they're not currently a goal: "Non-goals: make channels completely lock-free (this would significantly complicate implementation and make it slower for common cases)" http://talks.golang.org/2014/go1.3.slide#8 http://talks.golang.org/2014/go1.3.slide#8