processes

listing processes and their connections

Hi I would like to make a small program listing running programs on my computer - this seems simple. But I would also like to detect their connections, ex.: I detect a running Internet Explorer (or other browser), but I would like to know which websites it is visiting. Another example; I detect Word is running, and would like to know wh...

Twisted - listen to multiple ports for multiple processes with one reactor

Hi, i need to run multiple instances of my server app each on it's own port. It's not a problem if i start these with os.system or subprocess.Popen, but i'd like to have some process communication with multiprocessing. I'd like to somehow dynamically set up listening to different port from different processes. Just calling reactor.lis...

Win32 C/C++ checking if two instances of the same program use the same arguments

Hello all, I have an application and I want to be able to check if (for instance) two instances of it used the same arguments on execution. To make it clearer: myapp 1 2 myapp 1 3 This isn't a Singleton design pattern problem as I can have more than one instance running. I though about checking the running processes, but it s...

Getting CPU time in OS X

I have an objective-c application for OS X that compares two sqlite DB's and produces a diff in json format. The db are quite large (10,000 items with many fields). Sometimes this applications runs in about 55 sec(using 95% of the cpu). Sometimes it takes around 8 min (using 12% of the cpu). This is with the same DB's. When it is only us...

C++ Process Checking

I'm creating a task-manager type application in C++, and I'm currently using: ` void MyFrame::ProcChecker(bool showmessage=false){ HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); PROCESSENTRY32 *processInfo = new PROCESSENTRY32; processInfo->dwSize = sizeof(PROCESSENTRY32); int index = 0; string procList = ""; ...

Finding the command for a specific PID in Linux from Python

I'd like to know if it's possible to find out the "command" that a PID is set to. When I say command, I mean what you see in the last column when you run the command "top" in a linux shell. I'd like to get this information from Python somehow when I have a specific PID. Any help would be great. Thanks. ...

Run arbitrary subprocesses on Windows and still terminate cleanly?

I have an application A that I would like to be able to invoke arbitrary other processes as specified by a user in a configuration file. Batch script B is one such process a user would like to be invoked by A. B sets up some environment variables, shows some messages and invokes a compiler C to do some work. Does Windows provide a stan...

Run Apache 2.2 as a single httpd.exe for debugging.

I'm running Apache 2.2 in console mode on Windows to test an apache module I'm writing. By default, a parent httpd.exe is started (with one thread), which starts a child httpd.exe with a number of worker threads. Now I have to attach the debugger to the child process each time to be able to debug my module. Is there a way to configure ...

When a parent process is killed by "kill -9", will subprocess also be killed?

One of my colleague told me this morning, when he killed supervisord by "kill -9", the subprocesses of supervisord is not killed. He is quite sure about that, but I tried many times and did not find that happen. So when a parent process is killed by "kill -9", will linux ensure that it's sub-processes also been killed? ...

Checking if multiple processes are running

I have a listbox that lists windows processes by their handle title, e.g. "Untitled - Notepad". What I would like to do is regularly check (using a timer?) if those processes are still open. I have stumbled across some code below, but that only takes one argument "string". I assume it would have to be an array of all items in the listbox...

linux: programmatically get parent pid of another process?

I tried google, but found getppid() which gets the parent pid of the current process. I need something like getppid(some_other_pid), is there such a thing? Basically takes the pid of some process and returns the parent process' pid. ...

Anything wrong with using PHP as a server side language?

Is it wrong to use PHP as a server side language? For functions such as mail notifications / fraud checks (look for data, flag, then email type approach) / db cleanup / upload folder cleanup / cronjob type functions etc; I've ran into some projects lately where I've been successful with this approach, but I'm not sure if its the wrong w...

How to determine if a process ID exists.

I'm using C# .NET 2.0. I need to determine if a PID exists. I came up with the following code: private bool ProcessExists(int iProcessID) { foreach (Process p in Process.GetProcesses()) { if (p.Id == iProcessID) { return true; } } return false; } Is there a better way to do this ot...

How to control the memory usage of processes spawned by a JVM

I am coding an application that creates JVMs and needs to control the memory usage of the processes spawned by the JVM. ...

How to determine Windows.Diagnostics.Process from ServiceController

This is my first post, so let me start by saying HELLO! I am writing a windows service to monitor the running state of a number of other windows services on the same server. I'd like to extend the application to also print some of the memory statistics of the services, but I'm having trouble working out how to map from a particular Ser...

Python, List running processes 64Bit Windows

Hey Guys, I amm writing a little python script that will grab information from VMs of Windows that I am running. At the moment I can list the processes on a 32bit XP machine with the following method: http://code.activestate.com/recipes/305279/ Is it possible to somehow detect the version of windows running and excute a different met...

How can I interact with the command prompt from C# code?

I am trying to interact with the windows command prompt from code. My goal is to display the prompt, put in some command, display the output, and repeat. But can't seem to get the first three working at the same time. private void button2_Click(object sender, EventArgs e) { Process proc = new Process(); pro...

strtok and execlp in a mini-shell

Hi fellows! I'm writing a mini-shell to get more familiar with Unix process management in C. It's reading stuff from commandline and passes these arguments via execlp to the system. # include <stdio.h> # include <stdlib.h> # include <unistd.h> #define MAXSIZE 100 char prompt[MAXSIZE]; int main(void){ pid_t pid; printf("> ...

Problem forking fork() multiple processes Unix

So I have this function that forks N number of child processes. However it seems to be forking more than specified. Can you tell me what I'm doing wrong? Thanks void forkChildren(int nChildren){ int i; for(i = 1; i <= nChildren; i++){ pid = fork(); if(pid == 0) printf("I'm a child: %d PID: %d\...

How can I get the full list of running processes on a Mac from a python app.

I want to get the list of running processes on the Mac, similar to what you get from 'ps -ea' I have tried os.popen('ps -ea') but this only lists a small subset of the processes, presumably those owned by the owning shell. Other options I have tried are 'sh -c /bin/ps -ea' 'bash -c /bin/ps -ea' 'csh -c /bin/ps -ea' Running as root vi...