09-04-2008 03:01 PM
09-04-2008 04:51 PM
Don't know about Linux, but all the NI function is doing is calling the Win32 SDK TerminateProcess function.
It is considered drastic to do this in the sense that, as you noted, DLL's aren't notified of the process/thread detach, handles are left open, file buffers not flushed, etc.
The Win32 philosophy is that the process should be signaled to terminate, and then terminates itself, since only the process directly "knows" what resources it has open. So you're stuck with polling of some kind or another, whereby the application has to periodically check and see if it's been told to terminate itself.
It may be that TerminateProcess results in a terminate message being sent to the main window message queue. The top level window in a CVI app is also a true window, and there's a message queue you can get to, in a roundabout way, as I recall.
As a general rule, I think the OS is able to pretty much clean up after a TerminateProcess call, though it's certainly not "clean". I think TerminateProcess is about the same as using the task manager to kill an application.
Menchar
09-11-2008 10:27 AM
Hello Guillaume,
I haven't been able to find a specific CVI function that will accomplish this for you in Linux, however, I believe you should be able to code your program to issue commands to the Linux Operating system. See the following links on how to terminate a process/executable in linux. Rather than calling a single function, you may need to write a few lines of code to issue the proper commands.
How Do I Stop a Running Program in Linux
Both of these links provide the same method of terminating the process/executable. I thought the first link was a little more informative and easier to read.
Hope this helps Guillaume!
09-21-2008 02:57 AM
hello Guillaume Dargaud
I am a student.There are some questions to ask you .I'll be appriciate to receive your apply.
I am using labwindows/CVI developping a instrument in embedded linux environment. I want to get the rpm package of labwindows/CVI run-time module to install it on linux OS,but I haven't find one in the web ,please tell me how can I get it ?
By the way ,can I get some example program from you ,if not ,can you tell me where there are.
I am waiting for your replly, Thank you very very much!!!
From:Yutian jin.
Beijing China
11-14-2008 10:40 AM