1.

Which is safer for concurrent data access? Channels or Maps?

Answer»

Channels are safe for concurrent ACCESS because they have blocking/locking mechanisms that do not LET goroutines share MEMORY in the presence of multiple threads.

Maps are unsafe because they do not have locking mechanisms. While using maps, we have to use explicit locking mechanisms like mutex for safely SENDING data through goroutines.



Discussion

No Comment Found