Skip to content
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

Can you provide API thread safety info in the README doc? #492

Closed
Kexiii opened this issue May 24, 2020 · 1 comment
Closed

Can you provide API thread safety info in the README doc? #492

Kexiii opened this issue May 24, 2020 · 1 comment

Comments

@Kexiii
Copy link

Kexiii commented May 24, 2020

I think it's necessary to tell the user whether the API is thread safe(e.g. Is Client::Get(..) thread safe?).

@yhirose
Copy link
Owner

yhirose commented May 24, 2020

@Kexiii, basically, Client is not thread-safe. Only one thread can own the Client instance. But as you can see in the Client class, sock_ is declared as std::atomic<socket_t>. You can hold it in a different thread and safely call stop() method safely. In this particular case only, Client can be said as thread-safe.

Sorry for the incomplete documentation on README. Since this is just my 'after work'/'weekend' project, I simply don't have time to update it... I'll improve the documentation when I have time. I guess I need to mention thread-safety for the server as well.

Thanks for your interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants