gobwas / pool

Go Pooling Helpers
MIT License
113 stars 18 forks source link

Is it thread safe? #4

Closed skrater closed 6 years ago

skrater commented 6 years ago

Seeing the code, you are using a map to get sync.Pool according with their size. AFAIK the golang map is not thread safe, or i'm wrong?

gobwas commented 6 years ago

Hi @skrater.

That map is read-only, e.g. it is not being changed over time. So that is why it is thread safe.