Questions tagged [process]

This tag is about operating system processes. It may also refer to a specific construct on a given platform, e.g., the System.Diagnostics.Process class for .NET

A process is an instance of a computer program being executed. Many operating systems let multiple processes run concurrently. The operating system takes care of isolating processes one from another in order to provide data integrity and also provides means for interprocess communication (IPC).

Process contains the program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.

A computer program is a passive collection of instructions; a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often means more than one process is being executed.

For security and reliability reasons most modern operating systems prevent direct communication between independent processes, providing strictly mediated and controlled inter-process communication functionality.

Resources

Process - Wikipedia

Processes and threads in Windows

What is a process in UNIX / Linux?

18168 questions
72
votes
10 answers

How do I kill a process using Vb.NET or C#?

I have a scenario where I have to check whether user has already opened Microsoft Word. If he has, then I have to kill the winword.exe process and continue to execute my code. Does any one have any straight-forward code for killing a process using…
bugBurger
  • 6,950
  • 9
  • 32
  • 39
71
votes
7 answers

How can I get a process handle by its name in C++?

I'm trying to get the process handle of, say example.exe, so I can call TerminateProcess on it. How can I do this? Notice, it doesn't have a window so FindWindow won't work.
Malfist
  • 31,179
  • 61
  • 182
  • 269
71
votes
7 answers

How do I automatically destroy child processes in Windows?

In C++ Windows app, I launch several long running child processes (currently I use CreateProcess(...) to do this. I want the child processes to be automatically closed if my main processes crashes or is closed. Because of the requirement that this…
jm.
  • 23,422
  • 22
  • 79
  • 93
71
votes
6 answers

Sharing a complex object between processes?

I have a fairly complex Python object that I need to share between multiple processes. I launch these processes using multiprocessing.Process. When I share an object with multiprocessing.Queue and multiprocessing.Pipe in it, they are shared just…
Paul
  • 2,115
  • 3
  • 17
  • 14
70
votes
9 answers

How to get the PID of a process by giving the process name in Mac OS X ?

I am writing a script to monitor the CPU and MEM of any given process. For that i need to send in the name of the process to be monitored as a commandline argument. For example. ./monitorscript I need to get the pid of the process in the…
Pradep
  • 1,874
  • 5
  • 21
  • 31
69
votes
9 answers

How to kill all subprocesses of shell?

I'm writing a bash script, which does several things. In the beginning it starts several monitor scripts, each of them runs some other tools. At the end of my main script, I would like to kill all things that were spawned from my shell. So, it might…
user80168
68
votes
7 answers

How to examine processes in OS X's Terminal?

I’d like to view information for processes running in OS X. Running ps in the terminal just lists the open Terminal windows. How can I see all processes that are running? Say I’m running a web browser, terminal and text editor. I’d like to see…
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
68
votes
7 answers

Get current ruby process memory usage

I'd like to format my Logger output to include the current memory usage, for part of a long-running process. Is there anything built-in to Ruby for this, a bit like PHP's memory_get_usage()? Or do I have to execute some shell commands to get it…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
68
votes
14 answers

How do you kill all Linux processes that are older than a certain age?

I have a problem with some zombie-like processes on a certain server that need to be killed every now and then. How can I best identify the ones that have run for longer than an hour or so?
yukondude
  • 24,013
  • 13
  • 49
  • 58
67
votes
6 answers

What is the difference between a thread/process/task?

What is the difference between a thread/process/task?
billu
  • 2,415
  • 3
  • 23
  • 31
67
votes
3 answers

How to terminate process from Python using pid?

I'm trying to write some short script in python which would start another python code in subprocess if is not already started else terminate terminal & app (Linux). So it looks like: #!/usr/bin/python from subprocess import Popen text_file =…
Alex
  • 3,167
  • 6
  • 35
  • 50
67
votes
6 answers

How to get PID of process by specifying process name and store it in a variable to use further?

By using "ucbps" command i am able to get all PIDs $ ucbps Userid PID CPU % Mem % FD Used Server Port ========================================================================= 512 5783 2.50 16.30 …
Nidhi
  • 829
  • 3
  • 8
  • 18
67
votes
2 answers

Get return value from process

Hi I am trying to do the following: I have a process which can take parameters (digits) and return the sum of these numbers Process P = Process.Start(sPhysicalFilePath, Param); int result = P.ExitCode; I get the return value from…
Hany
  • 1,146
  • 4
  • 18
  • 26
66
votes
4 answers

How do I show running processes in Oracle DB?

Is it possible to show other processes in progress on an Oracle database? Something like Sybases sp_who
Robert Brown
  • 10,888
  • 7
  • 34
  • 40
65
votes
4 answers

Launching process in C# Without Distracting Console Window

I figure out how to launch a process. But my problem now is the console window (in this case 7z) pops up frontmost blocking my vision and removing my focus interrupting my sentence or w/e i am doing every few seconds. Its extremely annoying, how do…
user34537