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
197
votes
15 answers

How do I start a process from C#?

How do I start a process, such as launching a URL when the user clicks a button?
WanKenoobi
195
votes
23 answers

How do I trim a file extension from a String in Java?

What's the most efficient way to trim the suffix in Java, like this: title part1.txt title part2.html => title part1 title part2
omg
  • 136,412
  • 142
  • 288
  • 348
193
votes
4 answers

node.js child process - difference between spawn & fork

This might seem like a basic question, but I could not find any documentation : What is the difference between forking & spawning a node.js process? I have read that forking is a special case of spawning, but what are the different use cases /…
Hitesh
  • 2,045
  • 2
  • 14
  • 9
192
votes
13 answers

How can I know if a process is running?

When I get a reference to a System.Diagnostics.Process, how can I know if a process is currently running?
reshefm
  • 6,017
  • 8
  • 36
  • 40
188
votes
6 answers

module is not defined and process is not defined in eslint in visual studio code

I have installed eslint in my machine and i have used visual studio code i have certain modules and process to be exported When i try to use "module" or "process" it shows it was working fine before. [eslint] 'module' is not defined.…
MaTHwoG
  • 1,911
  • 2
  • 7
  • 11
181
votes
16 answers

Kill child process when parent process is killed

I'm creating new processes using System.Diagnostics.Process class from my application. I want this processes to be killed when/if my application has crashed. But if I kill my application from Task Manager, child processes are not killed. Is there…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
176
votes
14 answers

Get exit code of a background process

I have a command CMD called from my main bourne shell script that takes forever. I want to modify the script as follows: Run the command CMD in parallel as a background process (CMD &). In the main script, have a loop to monitor the spawned command…
bob
  • 1,761
  • 2
  • 11
  • 3
175
votes
9 answers

How to spawn a process and capture its STDOUT in .NET?

I need to spawn a child process that is a console application, and capture its output. I wrote up the following code for a method: string retMessage = String.Empty; ProcessStartInfo startInfo = new ProcessStartInfo(); Process p = new…
FlySwat
  • 172,459
  • 74
  • 246
  • 311
174
votes
9 answers

Kill some processes by .exe file name

How can I kill some active processes by searching for their .exe filenames in C# .NET or C++?
Aliasghar Yaghoobzadeh
  • 1,881
  • 2
  • 12
  • 10
173
votes
11 answers

How do I get the path of a process in Unix / Linux?

In a Windows environment there is an API to obtain the path which is running a process. Is there something similar in Unix / Linux? Or is there some other way to do that in these environments?
lsalamon
  • 7,998
  • 6
  • 50
  • 63
171
votes
31 answers

Taskkill /f doesn't kill a process

When I start up an Experimental instance of VS from VS for debugging and stop debugging (sometimes directly from the parent VS), a zombile devenv.exe process remains running which I am unable to kill. It holds on to many of my dlls. As I am logged…
dushyantp
  • 4,398
  • 7
  • 37
  • 59
161
votes
11 answers

Executing Batch File in C#

I'm trying to execute a batch file in C#, but I'm not getting any luck doing it. I've found multiple examples on the Internet doing it, but it is not working for me. public void ExecuteCommand(string command) { int ExitCode; ProcessStartInfo…
Wessel T.
  • 2,280
  • 2
  • 20
  • 29
156
votes
24 answers

Make sure only a single instance of a program is running

Is there a Pythonic way to have only one instance of a program running? The only reasonable solution I've come up with is trying to run it as a server on some port, then second program trying to bind to same port - fails. But it's not really a…
Slava V
  • 16,686
  • 14
  • 60
  • 63
155
votes
9 answers

Thread context switch Vs. process context switch

Could any one tell me what is exactly done in both situations? What is the main cost each of them?
Leon
  • 8,151
  • 11
  • 45
  • 51
145
votes
9 answers

Any way to write a Windows .bat file to kill processes?

Every time I turn on my company-owned development machine, I have to kill 10+ processes using the Task Manager or any other process management app just to get decent performance out of my IDE. Yes, these are processes from programs that my company…
codeLes
  • 3,021
  • 3
  • 29
  • 27