pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar-client-go] merlimat opened a new pull request #298: Added semaphore implementation with lower contention
Date Wed, 24 Jun 2020 00:15:26 GMT

merlimat opened a new pull request #298:
URL: https://github.com/apache/pulsar-client-go/pull/298


   ### Motivation
   
   When there are multiple go-routines sharing a single producer instance, there can be significant
contention on the channel that is used as a semaphore. 
   
   That is because the channel is internally implemented with a mutex.
   
   Instead, use a counter to optimize for the normal case scenario (when we're not blocked
by the semaphore), leaving the channel as a way to synchronize when the semaphore has exhausted
all the permits.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message