Answer the question
In order to leave comments, you need to log in
Why is there no detach method for threads in C# like in C++?
Can someone explain why C# doesn't have a method like detach for threads like C++ does?
Answer the question
In order to leave comments, you need to log in
I'm not a C++ expert, so please correct me if I'm wrong.
As far as I understand, detach in C ++ is needed to "detach" a child thread from the main one? Those. If the main thread terminates, does the child continue to run?
For Thread in C# there is a property IsBackground https://docs.microsoft.com/ru-ru/dotnet/api/system... maybe this is the analogue you need?
"There are two types of threads: foreground and background threads. Background threads are automatically terminated when the foreground threads finish"
"We can change the types of threads ourselves. The IsBackground thread property determines whether the thread is in the background. Thus, we can make the thread a priority"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question