Home > Net >  Ask: how to force quit unmanaged c # code thread
Ask: how to force quit unmanaged c # code thread

Time:11-28

In c #, the child thread invokes the DLL written in c + + interface, this interface if cannot return in excess of the prescribed time, the main thread will be forced to close the child thread,
C # Thread. Abort () no, you have what method does not, show just a little trouble, thank you very much ~

CodePudding user response:

How is in the DLL call the function block, he has to take up some unmanaged resources system? If any in your writing Thread. The Abort () turn off these resources,
But I still suggest you to take a look at this DLL files, since the somebody else all wrapped up, there must be for you meet this kind of situation

CodePudding user response:

Can only see the interface of the text: the interface normal will return true or false, don't throw an exception, is there any way to kill the DLL directly threads, the method of simple and crude

CodePudding user response:

Thread. The abort () will throw an exception within the child thread, you in your program to add a try... The catch... See if you can capture this exception

CodePudding user response:

off the power supply,

CodePudding user response:

Then call Proccess, find the process, directly kill it

CodePudding user response:

Encountered similar problems, same target thread cannot use Abort () to terminate, could you tell me you is how to deal with,

CodePudding user response:

reference 4 floor interacting in a professional developer response:
off the power supply,

Dude, you made me laugh

CodePudding user response:

To load the DLL appdomain

CodePudding user response:

The exit ()

CodePudding user response:

references 9 floor puzzle bobble reply:
to get inside the appdomain load the DLL


Truth, other people's things hang up and we can do is to isolate him, try to restore him,
Appdomain can
In addition to do exe separately under the front cover can

Simple said is similar to polly Isolation plate (Bulkhead Isolation)

Yes, we have not the same, sick is isolated, to avoid problems, and then try to treat his
The introduction of polly
https://blog.csdn.net/letnet1981/article/details/78120802

CodePudding user response:

Multithreaded make uncertain, can process more,
No response does not lead to the other process abnormal
Response after a timeout, the process directly to kill off
  •  Tags:  
  • C#
  • Related