Is .NET equivalent to Java threading groups?

I am trying to control the state of a thread group in a Microsoft.NET application written in C #. I would also like to keep track of any child threads generated by source threads.

In Java, you can assign threads to a group of threads, and their children will also belong to the group. Is there an equivalent in .NET?

I briefly looked at ExecutionContext and LogicalCallContext, but I donโ€™t see how to find all the threads that are in context. Raymond Chen has an article on the Win32 API method for listing threads, but I hope I don't need to do this.

+3
source share
3 answers

, Threads System.Diagnostics.Process.

, , , , , , (.. System.Threading.Thread).

, AFAIK.

+3

- API- "", .

+2

Make it simple:

Create your ThreadGroup class using a method that completes the thread creation process.

When this method is called, it adds the created stream to the collection, and there is your group.

+1
source

Source: https://habr.com/ru/post/1697731/


All Articles