I had the idea to solve the problem of listing managed flows in .Net and to track the ancestry thread (which thread created the other thread).
If you could mark a Thread object with a programmer object object that is automatically copied to child threads when they are created, it may be possible to use this tag to track when creating new threads, who created them, etc. The inspiration came from unix, where when a process forks, it inherits open file descriptors, etc. If there were any part of the data that is 1) a local thread or attached to a Thread object, and 2) automatically copied to new threads and 3) can be changed, this would be a good start.
I assume that we will have to use reflection to access the elements of some Thread object that starts the chain, because most of what I see in the thread, which can be useful, is otherwise blocked, but this is the beginning, I'm not sure how reasonable is this approach.
Edit: I think I will explain my use case better because I don't think anyone understands.
I know about thread tracking explicitly, which I did mostly in the code that I have before. It's not a problem.
Basically, I am trying to implement a "thread-group-context", much like .Net has an appdomain context, remote access context [1] and thread-combination - local context [2] .
, , . , .NET ( !), , .Net , .
, , : API, . API , , , . API, API. API, . , , , , , API AppDomain. .
, API . , API, API, .
, API , ( ).
- GetContextObject() API. API , . GetContextObject(), , , .
, , 100% . API. API , , , - , , , , .
, , , , .
, .
, :
1) API , . trundling ~ 1 LOC.
1a) Thread, , MyApiThread, . , # 1, .
2) API API AppDomain, ( "" ). AppDomains , .
3) , . .
, , Windows , - . DotNet Windows, , , , .NET Linux, Solaris, FreeBSD Mono. , Java , , Java Windows, . , .Net api Microsoft , , , ,.Net Windows .