kill

How to force kill another application in cocoa Mac OS X 10.5

我的梦境 提交于 2019-12-08 08:04:37
问题 I've this task, from my application i need to kill another my application, the problem is that the other application has a Termination Confirm Dialog (there is no critical data to save, only confirmation of user intent to quit). On 10.6+ you will use: bool TerminatedAtLeastOne = false; // For OS X >= 10.6 NSWorkspace has the nifty runningApplications-method. if ([NSRunningApplication respondsToSelector:@selector(runningApplicationsWithBundleIdentifier:)]) { for (NSRunningApplication *app in

How can I kill forked processes that take too long in my perl script without timing out the forked process?

点点圈 提交于 2019-12-08 04:57:09
问题 I've been using the following template for all of my forking/processes needs when it comes to processing "things" in parallel. It basically loops through everything I need to process, X number of entries at a time, and time's out any entries that take too long: my $num_procs = 0; foreach my $entry (@entries) { $num_procs++; if($num_procs == $MAX_PROCS) { wait(); $num_procs--; } my $pid = fork(); if($pid == 0) { process($entry); } } for (; $num_procs>0; $num_procs--) { wait(); } The "process"

Java : How to stop a Thread that's calling a succession of C++ functions using a JNI function?

此生再无相见时 提交于 2019-12-08 01:36:07
问题 So, here is my situation : I've got a Java application that is sending arrays of data to a C++ DLL using a JNI method from a "JavaToCpp" class. Once the C++ DLL have received all the data, it begins performing several actions on it. I'm running the "JavaToCpp" class using a new thread, for my Java interface not to be frozen during the (long) (C++) procedures/subroutines. I implemented two methods to stop the working (C++) procedures/subroutines : The first one "STOP" : is creating a file

kill process/ end process of bluestacks

纵饮孤独 提交于 2019-12-07 17:16:54
问题 I'm trying to make a program that will open and close bluestacks application. Close means totally exiting the application. Since even if you exit the bluestacks app the process will just restart. The processes I'm trying kill is: "HD-BlockDevice.exe" "HD-Agent.exe" "HD-LogRotatorService.exe" "HD-UpdaterService.exe" When I manually kill the first process, the other process will close except for the 2~3 ones. It's kinda pain to kill four processes every time i close the application so i am

How do I kill a runaway Java process started by Ant?

北慕城南 提交于 2019-12-07 16:47:29
问题 If I start a forked java process from an ant script and kill the ant process, it does not kill the java process. This is the case whether running it from the IDE or from the command line. <target name="myTarget" > <java classname="path.to.MyClass" fork="yes" failonerror="true" maxmemory="128M"> <classpath refid="run" /> </java> </target> Is there a way to link these, so that killing the ant process will kill the java process? I've seen the following Q&A - but this seems to focus on how to

android force kill schedule service every minute

那年仲夏 提交于 2019-12-07 15:00:36
问题 I want to schedule a service to run every minute and check if my app is still running. (I want to reopen the application if it is closed). Also, I still want this service to run every minute if my application was force killed by task manager. Thanks! 回答1: Also, I still want this service to run every minute if my application was force killed by task manager This is not possible as of Android 3.1. If the user goes into Settings and force=stops your app, nothing of your app will run again, until

Kill random process with name

旧街凉风 提交于 2019-12-07 12:14:44
问题 I want a way to kill a random process with a name (eg a random perl process). What would be the best way of doing this? I was thinkign of using something like this: ps aux | grep PROCESS-NAME to a file, then find a random line number, get the second column (process ID?) and kill that. For my use it doesn't actually need to be a random one, as long as it kills one of the processes. Making it random just makes it better. 回答1: Bash one-liner :-p kill `ps auxww | grep zsh | awk '{print $2}' |

PHP - kill exec on client disconnect

为君一笑 提交于 2019-12-07 08:46:03
问题 I have very primitive web front-end for my C++ application. Client (web browser) is enters php site and fills form with parameters. Than (after post submit) php calls exec and application does its work. Application can work longer than minute and requires pretty large amount of RAM. Is there any possibility to detect disconnecting from client (for example closure of tab in web browser). I want to do this, because after disconnecting client will not be able to see result of computations, so I

How can I kill a process, using VBScript, started by a particular user

偶尔善良 提交于 2019-12-07 05:49:15
问题 I have multiple users running attachemate on a Windows 2003 server. I want to kill attachemate.exe started by user_1 without killing attachemate.exe started by user_2. I want to use VBScript. 回答1: You could use this to find out who the process owner is, then once you have that you can use Win32_Process to kill the process by the process ID. MSDN Win32_Process class details MSDN Terminating a process with Win32_Process There is surely a cleaner way to do this, but here's what I came up with.

How to do lengthy operations without being killed by the watchdog? iphone

故事扮演 提交于 2019-12-06 11:06:14
问题 I have an important operation that is executed rarely. In some cases, it might take minutes to execute. My app is getting killed after a 50 second operation. How to avoid that? Should I put it in a background thread? Could anyone please point me in the right direction here. I have not found any useful information about the so called watchdog. Is a background thread the way to go? 回答1: Yes, you need to move this task to a background thread. You should never jam up the main thread with any task