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
335
votes
13 answers

What resources are shared between threads?

Recently, I have been asked a question in an interview what's the difference between a process and a thread. Really, I did not know the answer. I thought for a minute and gave a very weird answer. Threads share the same memory, processes do not.…
Xinus
  • 29,617
  • 32
  • 119
  • 165
323
votes
12 answers

How to pause / sleep thread or process in Android?

I want to make a pause between two lines of code, Let me explain a bit: -> the user clicks a button (a card in fact) and I show it by changing the background of this button: thisbutton.setBackgroundResource(R.drawable.icon); -> after let's say 1…
Hubert
  • 16,012
  • 18
  • 45
  • 51
308
votes
20 answers

How to prevent a background process from being stopped after closing SSH client in Linux

I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a…
GetFree
  • 40,278
  • 18
  • 77
  • 104
283
votes
16 answers

Threads vs Processes in Linux

I've recently heard a few people say that in Linux, it is almost always better to use processes instead of threads, since Linux is very efficient in handling processes, and because there are so many problems (such as locking) associated with…
user17918
  • 3,018
  • 3
  • 19
  • 7
273
votes
11 answers

How do I capture the output into a variable from an external process in PowerShell?

I'd like to run an external process and capture it's command output to a variable in PowerShell. I'm currently using this: $params = "/verify $pc /domain:hosp.uhhg.org" start-process "netdom.exe" $params -WindowStyle Hidden -Wait I've confirmed…
Adam Bertram
  • 3,858
  • 4
  • 22
  • 28
251
votes
5 answers

The difference between fork(), vfork(), exec() and clone()

I was looking to find the difference between these four on Google and I expected there to be a huge amount of information on this, but there really wasn't any solid comparison between the four calls. I set about trying to compile a kind of basic…
user476033
  • 4,607
  • 8
  • 32
  • 35
247
votes
24 answers

How to make child process die after parent exits?

Suppose I have a process which spawns exactly one child process. Now when the parent process exits for whatever reason (normally or abnormally, by kill, ^C, assert failure or anything else) I want the child process to die. How to do that…
Paweł Hajdan
  • 18,074
  • 9
  • 49
  • 65
245
votes
11 answers

How to check if a process id (PID) exists

In a bash script, I want to do the following (in pseudo-code): if [ a process exists with $PID ]; then kill $PID fi What's the appropriate expression for the conditional statement?
Richard H
  • 38,037
  • 37
  • 111
  • 138
244
votes
9 answers

Wait until a process ends

I've an application which does Process.Start() to start another application 'ABC'. I want to wait till that application ends (process dies) and continue my execution. How can I do it? There may be multiple instances of the application 'ABC' running…
NLV
  • 21,141
  • 40
  • 118
  • 183
219
votes
5 answers

Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes

What exactly are process and update in PrimeFaces p:commandXxx components and execute and render in f:ajax tag? Which works at the time of validation? What does update attribute do rather than updating value to component from back end? Do process…
Shardendu
  • 3,480
  • 5
  • 20
  • 28
212
votes
15 answers

Wait for a process to finish

Is there any builtin feature in Bash to wait for a process to finish? The wait command only allows one to wait for child processes to finish. I would like to know if there is any way to wait for any process to finish before proceeding in any…
Biswajyoti Das
  • 7,881
  • 11
  • 34
  • 26
211
votes
43 answers

Quick-and-dirty way to ensure only one instance of a shell script is running at a time

What's a quick-and-dirty way to make sure that only one instance of a shell script is running at a given time?
raldi
  • 21,344
  • 33
  • 76
  • 86
210
votes
13 answers

Viewing full output of PS command

when I run ps -aux command on my linux server, to which I connected using putty, few processes are too long to fit in my current window width. Is there an alternative? -- Update -- I am sorry for downgrading,I thought others won't find the answer…
Boolean
  • 14,266
  • 30
  • 88
  • 129
208
votes
6 answers

What are the differences between the threading and multiprocessing modules?

I am learning how to use the threading and the multiprocessing modules in Python to run certain operations in parallel and speed up my code. I am finding this hard (maybe because I don't have any theoretical background about it) to understand what…
198
votes
11 answers

top -c command in linux to filter processes listed based on processname

top -c Top lists all the processes, there are good options to filter the processes by username by using the option -u but I am wondering if there is any easy way to filter the processes based on processname listed under COMMAND column of the top…
user1615330