Mutex: Difference between revisions

40 bytes removed ,  13 years ago
m
→‎sync.Mutex: shortened url
(→‎{{header|Go}}: added channel version)
m (→‎sync.Mutex: shortened url)
Line 298:
2
</pre>
Read-write mutex is provided by the <tt>sync.RWMutex</tt> type. For a code example using a RWMutex, see [http://rosettacode.org/wiki/Atomic_updates#RWMutex [Atomic updates#RWMutex]].
 
===Channels===
If a mutex is exactly what you need, sync.Mutex is there. As soon as things start getting complicated though, Go channels offer a much clearer alternative. As a gateway from mutexes to channels, here is the above program implemented with channels:
1,707

edits