Re:Another go at Go failed
by jamra on Wednesday January 08, 2014 @12:17PM
(#7024826)
That is only one way of doing things. Even though channels facilitate that method, it is not unidiomatic to not use them.
Channels are a way of queueing work, which is great for many use cases.
You can use mutexes and shared memory if your situation calls for it. For example, if I am doing a graph traversal concurrently, I can use channels to send the work to many listening threads as I traverse that graph synchronously.
If for some reason, I need to update that graph's representation asynchronously, I may need to use mutexes to lock the graph since the graph is now shared memory.
Channels are a way of queueing work, which is great for many use cases.
You can use mutexes and shared memory if your situation calls for it. For example, if I am doing a graph traversal concurrently, I can use channels to send the work to many listening threads as I traverse that graph synchronously.
If for some reason, I need to update that graph's representation asynchronously, I may need to use mutexes to lock the graph since the graph is now shared memory.