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

CRYPTO_set_id_callback #10

Open
JanWielemaker opened this issue Feb 26, 2015 · 2 comments
Open

CRYPTO_set_id_callback #10

JanWielemaker opened this issue Feb 26, 2015 · 2 comments

Comments

@JanWielemaker
Copy link
Member

Which id provider to use? see 4fddba0

@thetrime
Copy link
Contributor

thetrime commented Mar 9, 2015

The Apple documentation warns that:
pthread_self() should be used, even on platforms where getpid() gives
different answers in each thread, since that may depend on the machine
the program is run on, not the machine where the program is being
compiled. For instance, Red Hat 8 Linux and earlier used LinuxThreads,
whose getpid() returns a different value for each thread. Red Hat 9
Linux and later use NPTL, which is Posix-conformant, and has a getpid()
that returns the same value for all threads in a process. A program
compiled on Red Hat 8 and run on Red Hat 9 will therefore see getpid()
returning the same value for all threads.

PL_thread_self seems like a reasonable choice as well, since it hides most of this stuff behind an API. I think for the winpthreads-2 you will need pthread_self()->tid, but for pthread-win32 you need just pthread_self() which is perhaps a bit ugly.

@JanWielemaker
Copy link
Member Author

If this is still a dubious thing wrt. portability, I propose using PL_thread_self(). Can you change that?

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