Answer the question
In order to leave comments, you need to log in
Is it necessary to lock the structure with a mutex if there is a concurrent write to different fields of the structure?
Is it necessary to lock the structure with a mutex if there is a concurrent write to different fields of the structure?
Answer the question
In order to leave comments, you need to log in
None of the built-in types in Go are competitively safe in the language specification. In the current implementation, you can write concurrently to different fields of a pointer-type struct, i.e. an explicit * , map , slice or channel reference. There are no guarantees that such code will not fall in other implementations or on other architectures.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question