Skip to content

Synchronization issues in Redis-QUIC #1097

Answered by nibanks
ssinghaldev asked this question in Q&A
Discussion options

You must be logged in to vote

Synchronization is hard! Whenever you have multiple threads sharing a resource (a connection) you're going to have to add some synchronization. Also, I'd strongly recommend staying away from any global mutex/lock design. As you already mentioned, if you have a lot of parallel threads trying to use it, you're going to have problems. Generally, the goal should be to have a lock specific to the smallest resource possible. This might be a whole connection. It might be for a "work queue" on a connection. When you have a shared object with multiple users of it, having a reference count on the object can also be a good idea. When a new user of the object comes along, you increment the ref count.…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ssinghaldev
Comment options

Answer selected by nibanks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants