processes

How do I start an out of process instance of a WCF service?

I would like to start a new instance of a wcf service host from another (UI) application. I need the service to be out of process because I want to make use of the entire 1.4GB memory limit for a 32bit .NET process. The obvious method is to use System.Diagnostics.Process.Start(processStartInfo) but I would like to find out whether it is...

Running multiple functions in php

I need to run several functions at the same time. I had successfully implemented in C# by creating an ElapsedEventHandler and executing it when a timer gets elapsed. In this way I could run a number of functions at the same time (delegates). How can I do the same thing using php? ...

How to effectively kill a process in C++ (Win32) ?

I am currently writing a very lightweight program so I have to use C++ since it is not bound to .NET framework which drastically increases size of the program. I need to be able to terminate process and to do that I need to get a process handle. Unfortuanately I haven't figured how to do that yet. P.S. I know that to kill a process yo...

inter-process communication on local machine using socket in perl and c#

Hi: I am working on a c# application that spawn new Processes to run Perl programs: I was wondering if there is a way to use socket interface to let perl program to talk to c# application. If using socket, the address has to be local host: 127.0.0.1? How to choose which port number to use? also, Since the C# application spawn a Proce...

C# get date/time a windows service started

Is there a way to get the date/time that a service last started in C#. I'm using this code now to check the status of services: ServiceController sc = new ServiceController(serviceName); // check sc.status for "Running" etc... with a Switch statement... Can I do it with this object? Or need WMI? (Reason: I'm writing a little BizT...

.NET processes in Task Scheduler

I have a program that executes another program and the main program continues when that program is finished. Process p = Process.Start("program2.exe"); while (!p.HasExited) Thread.Sleep(10000); if (p.HasExited) { // Execute more code } This works great as when I run the program. But does not work when it is used as a schedule...

If 'Process.HasExited' throws an exception, can I assume that the process is gone?

I have the following code section, designed to count how many Excel processes are currently open: Func<int> OpenExcelProcessesCount = () => System.Diagnostics.Process.GetProcessesByName("Excel") .Where(p => !p.HasExited) .Count(); And then later I retrieve the count at various points, with code such as...

BlackBerry - background application to listen starts and foreground app

Hi everyone! I would like to create background application which will listen to what applications are started and what are moved to foreground. Please reply If question is not clear will explain again. Thanks ...

Capturing program output.

i am making a small library that will basically capture the standard outputs of a program (such as printf()) into a separate process/thread...this process should then perform certain tasks (lets say write these captured outputs to a file)...i am just beginning to do serious C programming so i am still learning. i wanted to know what is ...

Stop users from locking up crashing Linux machine using simple C code

Hi Is there a way to prevent users from locking up a linux machine with code something along the lines of: #import <stdio.h> int main (int argc, char** argv) { while (1) fork(); } The computers in question are in a computer lab, so I can't exactly disallow compiling... but is there some way of ensuring such processes only...

Blackberry - Create an application which will lock another application event

Actually I want to make an application which will getGlobalEvent and control that event through another custom application. Is there any way to do so. Can i get global event from a particular application? Its like an application which will lock custom application in your blackberry, if you add following application in that locking app li...

Concurrency and Multithreading

I'm not very experienced with subjects such as Concurrency and Multithreading. In fact, in most of my web-development career I had never needed to touch these subjects. I feel like it's an important concept, especially for Desktop applications and basically any other application that doesn't generate HTML :). After reading a bit on con...

Spawning multiple processes with PHP to proccess data.

I have a queue (Amazon SQS) of data that needs to be processed, and I would like to do it with multiple processes (in PHP). I want the child workers to do something like this (pseduoish code): while(true) { $array = $queue->fetchNItems(10); // get 10 items if(!count($array)) killProcess(); foreach($array as $...

How to find what executable the user has just started?

I'm working on a testing framework that needs to be able to record a user's activities and then replay them. I'm fine using the ManagedWinAPI wrappers around P/Invoke ( working in C# ) to record mouse and keyboard activity, which works but I think that in order to make the recording more useful I need to know more about what happens when...

How can I get a list with all the threads created by my application

Hi, I want to get a list with all the threads (except the main, GUI thread) from within my application in order to do some action(s) with them. (set priority, kill, pause etc.) How to do that? ...

iPhone System Processes by CPU Rate (top/ps)

What is the best way to programmatically access the processes sorted by cpu rate on the iPhone (similar to that seen in the *nix top command)? sysctl()? ...

How do I attach to a running process like a debugger on linux?

What system calls are used? I want to use it to read memory locations scattered inside a different process's address space. Is this a reasonable use case for this mechanism? ...

What is the difference between these two methods of killing a process?

I am writing a C# application that, among other things, automatically closes the advertisement a certain game displays after the user exits the game. My program accomplishes this by killing the game process when it detects that the user has exited the game. My program is similar to an Autohotkey script written by someone else that does s...

Running process as a user from windows service failing with Access is Denied?

I am working on a project that requires sandboxing an application. I am able to create a windows user, create a directory, fill the directory with an application, and run the application as a user. This works completely fine running as a console application, but when I install it as a service, I get this exception: System.ComponentModel...

Windows process management using Python

I need a script that check if a particular process is running and return something if not found. I know that this can be done using subprocess, but is there a simpler way to do it? ...