

Advanced Go Concurrency Patterns (2013) - joubert
http://talks.golang.org/2013/advconc.slide#1

======
bsaul
Is there a performance comparison anywhere between creating a big API of
channel, each for every different task that you may want to achieve ( let's
say add/search/remove from a global slice), versus simply performing mutex to
protect the state mutation ?

I've seen a golang informal chat where one of the golang team member
advertized using mutex instead of having a huge select, but i wonder if anyone
has real experience of the two here.

~~~
thirsteh
RWMutex (or Mutex if every op is a write op) is faster since it's just a
couple counters and atomic AddInt. Channels are more intuitive for some tasks,
and less for others. Don't try to use channels anywhere, especially when
you're just synchronizing access to something.

Source: Have written and benchmarked many, many Go programs.

~~~
Hagelin
s/anywhere/everywhere/ ?

~~~
thirsteh
Sorry, yes.

------
mseepgood
Video here:
[https://www.youtube.com/watch?v=QDDwwePbDtw](https://www.youtube.com/watch?v=QDDwwePbDtw)

------
namelezz
Does anyone know what pros and cons this pattern have compared to callbacks? I
note most UIs developments still use callback approach.

------
nnain
I like these slides that are hosted on golang.org -- navigating them on the
browser gets a bit restrictive though. I figured if you "Print/Save to pdf"
from your web browser, you can get a nice pdf copy.

------
ashearer
Excellent talk, even if you've seen it before.

Note that the slide viewer scrolls horizontally across the first few slides,
but you need to use the keyboard (spacebar) to advance further.

------
stesch
> This talk was presented at Google I/O in May 2013.

~~~
dang
...and discussed here:
[https://news.ycombinator.com/item?id=5760532](https://news.ycombinator.com/item?id=5760532)

