Switch to sync.RWMutex globally #30

Closed
opened 2 years ago by makeworld-the-better-one · 1 comments
makeworld-the-better-one commented 2 years ago (Migrated from gitlab.com)
Owner

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 2 years ago (Migrated from gitlab.com)
Owner

Thanks!

Thanks!
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.