kill

Killing OpenCL Kernels

天涯浪子 提交于 2019-12-22 10:13:25
问题 Is there any way to kill a running OpenCL kernel through the OpenCL API? I haven't found anything in the spec. The only solutions I could come up with are 1) periodically checking a flag in the kernel that the host writes to when it wants the kernel to stop, or 2) running the kernel in a separate process and killing the entire process. I don't think either of those are very elegant solutions, and I'm not sure #1 would even work reliably. 回答1: No, the OpenCL API doesn't allow to interrupt a

kill - does it kill the process right away?

二次信任 提交于 2019-12-22 09:00:12
问题 what does kill exactly do? I have a parent process which is creating 100 (as an example) child processes one after another. At the end of any child's job, I kill the child with kill(pid_of_child, SIGKILL) and I cannot see that in ps output. But if something goes wrong with the parent process and I exit from the parent process with exit(1) (at this point only 1 child is there - I can check tht in ps ), at that point I see a lot of <defunct> processes whose ppid is pid of parent process. How is

kill - does it kill the process right away?

末鹿安然 提交于 2019-12-22 09:00:09
问题 what does kill exactly do? I have a parent process which is creating 100 (as an example) child processes one after another. At the end of any child's job, I kill the child with kill(pid_of_child, SIGKILL) and I cannot see that in ps output. But if something goes wrong with the parent process and I exit from the parent process with exit(1) (at this point only 1 child is there - I can check tht in ps ), at that point I see a lot of <defunct> processes whose ppid is pid of parent process. How is

alternative to finish() method for Service class? To kill it dead

泪湿孤枕 提交于 2019-12-22 01:51:48
问题 I have used the method finish() before in several activities without problems. however when I tried to call it inside of the broadcast receiver I get the error message from the compiler that "the method finish() is undefined for the type AudioService" AudioService is the name of my Service class in my Android app. If there is no finish() method in a Service than what can I call to kill this Service dead? 回答1: use this line: this.stopSelf(); to kill itself. Or from outside use stopService

If I kill a System.Diagnostics.Process with .Kill(), do I also need to call .Close()?

Deadly 提交于 2019-12-21 07:13:10
问题 Using C# 4.0, I've created a System.Diagnostics.Process that I expect to take a short amount of time to run. If for some reason the process hasn't exited after some amount of time (e.g, I've called .WaitForExit(timeout) and the return value was false ), I need to cleanup. I've decided that it's safe to use .Kill() in this particular situation (there are no data structures I'm worried about corrupting). Given this setup, do I also need to call the .Close() method of the Process? If so, should

Perl, waiting for non-child process to exit

十年热恋 提交于 2019-12-21 06:01:13
问题 I have a script which is used to redeploy a couple programs in a custom server environment, (ie: not an established standard container which has code hotswapping). To do this, it takes down the server processes, but these take some time to fully close all their connections. These aren't child processes of the perlscript. They run for hundreds of days at a time normally, so I'd rather not have to wrap the server processes in perlscripts just so I can fork them to shut them down elegantly

warning: implicit declaration of function 'kill'

社会主义新天地 提交于 2019-12-21 03:49:44
问题 I am making these inclusions: #include <signal.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> But still getting this warning. 回答1: You are probably passing the "-ansi -Wall" switches to the gcc compiler. You can remove "-ansi" if you don't need it, otherwise try to set the proper feature define macro. Something like: #define _POSIX_SOURCE #include <sys/types.h> #include <signal.h> #include <unistd.h> #include <sys/wait.h> 回答2: You can also define it on the compile time by

The right way to kill a process in Java

心已入冬 提交于 2019-12-21 03:31:12
问题 What's the best way to kill a process in Java ? Get the PID and then killing it with Runtime.exec() ? Use destroyForcibly() ? What's the difference between these two methods, and is there any others solutions ? 回答1: If the process you want to kill has been started by your application Then you probably have a reference to it ( ProcessBuilder.start() or Runtime.exec() both return a reference). In this case, you can simply call p.destroy() . I think this is the cleanest way (but be careful: sub

Android - Kill App from another App (on a rooted device)

人盡茶涼 提交于 2019-12-21 02:53:08
问题 I have a rooted Android device. At one point I launch a secondary application from my primary application like so: Intent intent = getPackageManager().getLaunchIntentForPackage("com.app.package"); startActivityForResult(intent, 100); I want to be able to kill this secondary application from the primary application. I am trying the following general procedure: // At an earlier point in time... Runtime.getRuntime().exec("su"); // The user grants permission // ... // At a later point in time...

Process.Kill() doesn't seem to kill the process

此生再无相见时 提交于 2019-12-20 09:48:28
问题 I am having trouble using Process.Kill() . I think I must be misunderstanding how it works. This is my test function. I start a long-running process ( ping -t ) and then kill it five seconds later. I can see the ping process show up, but the process is still there after my program finishes. I have to kill it manually. Console.WriteLine("Total number of ping processes is {0}", Process.GetProcessesByName("ping").Length); ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); Process