confluent-kafka-go icon indicating copy to clipboard operation
confluent-kafka-go copied to clipboard

removed the readers-writer lock

Open emasab opened this issue 2 years ago • 0 comments

and used an exclusive lock

The read lock alone is requested only when the key is not in cache and multiple Get requests are made concurrently. The ToMap method is called only from the client is holding an exclusive lock. Also, the lock is hold only for a short time, being an in memory cache.

The speed gain shouldn't be noticeable so simplicity can be preferred.

emasab avatar Jul 01 '22 15:07 emasab