5 ms·
I had a similar experience in the opposite direction. Two weeks ago I moved some code from a mutex-based design (including a map of string to mutex, which itsel
by gort 11y ago
I had a similar experience in the opposite direction. Two weeks ago I moved some code from a mutex-based design (including a map of string to mutex, which itself needed to be behind a mutex) to channels, and I love it, though the result seemed about 10% slower.
I guess the message is: everything has its place; don't make a straight-jacket for yourself.
- dilap 11y agoNo doubt it's quite easy to go down ratholes using mutexes and whatnot. It's a very low-level way of synchronizing. The OPs critques of the specific design of channels as implemented by Go seem on-point to me.