Suppose the main thread is spawning a new thread t1, how can my code that runs on t1 find the thread id of the main thread (using c#)?
Edit:
I don't control the creation of the new thread. So I can't pass any parameters to the thread.
Thanks.
The java. lang. ThreadGroup. getParent() method returns the parent of this thread group.
Thread CreationThe creating thread is the parent thread, and the created thread is a child thread. Note that any thread, including the main program which is run as a thread when it starts, can create child threads at any time.
No. There is no copy of parent stack which is passed on to child.
Thread is a foreground thread. You have tasks that cause the thread to block for long periods of time. The thread pool has a maximum number of threads, so a large number of blocked thread pool threads might prevent tasks from starting. You need to place threads into a single-threaded apartment.
You can't.
Yet you might consider:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With