8000 Understand implications of multi-threading with openssl library · Issue #5 · bets42/42bets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Understand implications of multi-threading with openssl library #5

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

Open
bets42 opened this issue Oct 10, 2012 · 0 comments
Open

Understand implications of multi-threading with openssl library #5

bets42 opened this issue Oct 10, 2012 · 0 comments
Labels

Comments

@bets42
Copy link
Owner
bets42 commented Oct 10, 2012

As per libcurl threading guidelines, implement Exchange classes such that they can use multiple bets42::arthur::http_client's (i.e. multiple exchange sessions to allow requests in parallel) in light of known openssl multi-threading issues.

From http://curl.haxx.se/libcurl/c/libcurl-tutorial.html

Multi-threading Issues

The first basic rule is that you must never simultaneously share a libcurl handle (be it easy or multi or whatever) between multiple threads. Only use one handle in one thread at any time. You can pass the handles around among threads, but you must never use a single handle from more than one thread at any given time.

libcurl is completely thread safe, except for two issues: signals and SSL/TLS handlers. Signals are used for timing out name resolves (during DNS lookup) - when built without c-ares support and not on Windows.

If you are accessing HTTPS or FTPS URLs in a multi-threaded manner, you are then of course using the underlying SSL library multi-threaded and those libs might have their own requirements on this issue. Basically, you need to provide one or two functions to allow it to function properly. For all details, see this:

OpenSSL

http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION

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

No branches or pull requests

1 participant
0