|
|
|
|
|
by johnisgood
370 days ago
|
|
So, what are the solutions if they are indeed not safe to do read / write concurrently? Like okay, I read "both []byte slices, which are not safe for concurrent r/w access", but then, what is the solution? If the claim is indeed true. |
|
- Make sure no one mutates the slice ever, making it safe to read
- Guarding the slice behind a mutex, requiring anyone who reads or writes it to lock the mutex first
- Using some kind of thread-safe slice implementation