Solution: Perform a Concurrent Read-Write Operation on a Map
Check the solution of the challenge to perform concurrent read-write operations on the map using a mutex.
We'll cover the following
Problem breakdown
Let’s walk through the problem step by step and write the code that performs the concurrent read and write operations on the map using mutexes only.
Create two functions read
and write
, both of which take two parameters of type map
and sync.Mutex
. The methods will look like this:
Get hands-on with 1200+ tech skills courses.