Switch to sync.RWMutex globally #30

Closed
opened 2020-07-08 03:48:44 +00:00 by makeworld-the-better-one · 1 comment
makeworld-the-better-one commented 2020-07-08 03:48:44 +00:00 (Migrated from gitlab.com)

I've noticed pretty much of all of the library functions use a sync.Mutex to ensure safe concurrency, which is great. But I was thinking that using sync.RWMutex would be better in all cases, since the mutex is invoked even when simply getting/reading a variable. Using sync.RWMutex and changing relevant lines to RLock and RUnlock would make the code more efficient.

I've noticed pretty much of all of the library functions use a `sync.Mutex` to ensure safe concurrency, which is great. But I was thinking that using `sync.RWMutex` would be better in all cases, since the mutex is invoked even when simply getting/reading a variable. Using `sync.RWMutex` and changing relevant lines to `RLock` and `RUnlock` would make the code more efficient.
makeworld-the-better-one commented 2020-08-02 17:34:13 +00:00 (Migrated from gitlab.com)

Thanks!

Thanks!
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/cview#30
No description provided.