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

A global library init function? #266

Open
bagder opened this issue Jan 23, 2017 · 7 comments
Open

A global library init function? #266

bagder opened this issue Jan 23, 2017 · 7 comments

Comments

@bagder
Copy link
Member

bagder commented Jan 23, 2017

(Discussion forked off a sub-thread in #261)

I think there's case for adding global library init and free functions to do global (single) initializations and then the corresponding cleanups.

OpenSSL has an initialization that's only necessary to do once per process, not once per context as we do now. It is even discouraged to get called without using the OpenSSL mutex locks when using threads, so it is also a reliability concern.

@mcmanus
Copy link
Contributor

mcmanus commented Jan 23, 2017 via email

@bagder
Copy link
Member Author

bagder commented Jan 23, 2017

It can only be done hidden in a safe manner if protected by a mutex though, and to protect with a mutex we'd need to add a pthread (or equivalent) requirement...

@weinrank
Copy link
Member

Mh, is it useful to do this quietly?

I think we should involve the user for these steps.
For example when initializing the usrsctp library, it is possible to set a UDP encapsulation port.
IMHO this should the configurable by the user.

@mcmanus
Copy link
Contributor

mcmanus commented Jan 23, 2017 via email

@mcmanus
Copy link
Contributor

mcmanus commented Jan 23, 2017 via email

@bagder
Copy link
Member Author

bagder commented Jan 23, 2017

It should also be noted that modern OpenSSL (>= 1.1.0) already depends on pthreads itself, so it isn't that far fetched I think.

@bagder
Copy link
Member Author

bagder commented Jan 23, 2017

If we have it mutex protected, we can have it done silently if not already done explicitly by the user. So we can in fact have it both ways. If we want to.

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

3 participants