process

How to kill all asynchronous processes

Suppose we have a BASH script running some commands in the background. At some time we want to kill all of them, whether they have finished their job or not. Here's an example: function command_doing_nothing () { sleep 10 echo "I'm done" } for (( i = 0; i < 3; i++ )); do command_doing_nothing & done echo "Jobs:" jobs sleep 1 ...

java Process stop entire process tree

I am using Java Runtime to run commands, including certain CVS commands. I use: process = runtime.exec ("cmd /C cvs..."); format for running the Process in Java I need to have the option of stopping it. For this I use the Java Process destroy method process.destroy(); However only the cmd is stopped not the cvs process. It con...

How to establish a two-way communication between Activity and Service in different process?

Hi everyone, I'm working on establishing a two-way communication between an Activity and a Service which runs in a different process. Querying the process from the Activity is no big deal. But I want the process to notify the Activity on events. The idea behind it is this: the service runs independently from the actual app. It queries ...

File locked by which process?

Is there a way in .Net to find out exactly which process has locked a file? EDIT: I'm doing this because I want to let my user know that they can't modify/open the file, because at the moment, another program they're using (such as Excel) has it open. Hopefully, this helps. ...

Linux Kernel programming: trying to get vm_area_struct->vm_start crashes kernel

Hi, this is for an assignment at school, where I need to determine the size of the processes on the system using a system call. My code is as follows: ... struct task_struct *p; struct vm_area_struct *v; struct mm_struct *m; read_lock(&tasklist_lock); for_each_process(p) { printk("%ld\n", p->pid); m = p->mm; v = m->mmap; ...

Can a java program "type" into another windows program like notepad

Hi is there anyway to type into a notepad.exe process from a JAVA process? ...

what is difference between fork and thread

Hi All, Can you any one explain me about what is difference between fork and thread ..? Thanks ...

How to control process affinity in .NET 2.0 ?

How to control process affinity in .NET 2.0 ? I am newbie in .Net. please help ! ...

Failed to Kill Process in SQL 2008

I have a process with the following information, and i execute the kill process to kill this id, and it return me "Only user processes can be killed." SPID:11 Status:BACKGROUND Login:sa HostName: . BlkBy: . DBName: SAFEMIG Command:CHECKPOINT Normally, all the session to login to this server, it should have a HostName which display...

C#/mono: get list of child processes on Windows and Linux

Hi all. I have the code below for getting a list of child processes on windows by interop'ing with ntdll. Is there an equivalent to 'NtQueryInformationProcess' on Linux, which get's me the process id of the parent of a specified process (like pbi.InheritedFromUniqueProcessId)? I need the code to run on Linux through Mono so hopefully I a...

Tag a process with a string

Hi guys, I am trying to reproduce Process Exporer's feature to tag a process running on the current machine with a Comment (Please see the Comment section in the Process properties in Process Explorer). I couldn't find any way to do it with managed code, had a try with wmic utility but I wasn't able to find a way to set a property to ...

C#/.NET: Process.HasExited returns true even though process is running??

I have been observing that Process.HasExited sometimes returns true even though the process is still running. My code below starts a process with name "testprogram.exe" and then waits for it to exit. The problem is that sometimes I get thrown the exception; it seems that even though HasExited returns TRUE the process itself is still ali...

Controlling maximum Java standalone running in Linux

Hi, We've developed a Java standalone program. We've configured in our Linux (RedHat ES 4) cron schedule to execute this Java standalone every 10 minutes. Each standalone may sometime take more than 1 hour to complete, or sometime it may complete even within 5 minutes. My problem/solution I'm looking for is, the number of Java standa...

What happens to other users if the .NET worker process crashes?

My knowledge of how processes are handled by the ASP.Net worker process is woefully inadequate. I'm hoping some of the experts out there can fill me in. If I crash the worker process with a System.OutOfMemoryException, what would the user experience be for other users who were being served by the same process? Would they get a blank scr...

Monitoring/Managing processes,deamons,threads

My problem domain is to monitor/manage, processes, threads, daemons, on a remote machine. I have not choosen a language as yet to write the tool. I am open to suggestions. Clarification: 1) By Monitoring I mean "knowing current running state, memory usage, process usage ". 2) Would prefer very little setup requirements imposed. Assumpt...

C#/.NET: Closing another process outside the main window

Hi, I just wanna ask your opinion/suggestion on how to 'terminate' a running application/process is C# Right now, I do have the following codes: Process myProcess; private void btnOpen_Click(object sender, RoutedEventArgs e) { DirectoryInfo di = new DirectoryInfo(System.Environment.GetFolderPath(Environment.Special...

Multiple threads or process with threads

Hi, this is for an assignment so I'm not looking for code. I have to simulate a game where each player has turns and needs to 'pay attention' to what's going on. So far, i know I'll need two threads for each player, one that will sleep until the player's turn and the other paying attention. My question is: Should I work each player as...

Process Management Solution

Hi All, I'm working on a project that requires a process management solution much like init.d but with the following requirements: 1) Working with Windows not Linux 2) Must be able to start/stop/restart programs written in heterogeneous languages. 3) Must be able to extend process manager to start / stop processes depending on run-mode...

Getting a pid of a process created in C#

Lets say that I'm trying to create a new process with the following code: System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); p.StartInfo.FileName = System.IO.Path.GetDirectoryName(System.Ref...

Where to start when programming process synchronization algorithms like clone/fork, semaphores

I am writing a program that simulates process synchronization. I am trying to implement the fork and semaphore techniques in C++, but am having trouble starting off. Do I just create a process and send it to fork from the very beginning? Is the program just going to be one infinite loop that goes back and forth between parent/child pr...