[Solved] Is it possible to get parent threadID from child? [closed]
Terminology correction: one thread may create another thread, not fork, which is usually used to mention one process forking another. No, a thread has no way to get another thread’s identifier. On Linux, you can check if gettid() == getpid() to find if it’s the main thread. Solaris has thr_main() to identify if the caller … Read more