-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the client is thread safe? #12
Comments
Hi! Unfortunately this client is not thread-safe. Nothing prevents a thread to alter the internal udp sender while another one is already sending metrics. |
@vthiery hi, Thanks for your response! About the un-thread safe client, do you have some suggestions to use it in web project? |
@hh23485 I suppose that, as long as you don't explicitly reconfigure or destroy the client while using it, it will be ok. In the context of a web project, one should first initialize/configure the client, the start spawning threads to treat requests concurrently, and make sure all the requests have been handled before destroying the client. |
@vthiery Sure, initialize only once, and destroy the client at the end of the application. But to be more clear, do you mean, it's safe to call the singleton client's |
It should be. The only sensitive piece is batching ( |
That's great, thanks for your explain. Thanks, again. |
@hh23485 have you had any issue related thread-safety? otherwise, I'll close this issue. |
@vthiery Sure, It looks good to me. |
If you came here because you wonder if this library is thread safe: Please have a look into this later PR: #29 |
@jakila thanks for pointing that out. I'll re-open this issue and hopefully get some time to investigate it soon |
Hi, thanks for the rare cpp statsd client!
We'd like to use the client but my concern is about if the client is thread safe?
if not do you have some suggestions to use the client in multi-threads web services?
The text was updated successfully, but these errors were encountered: