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
2910
votes
40 answers

Find (and kill) process locking port 3000 on Mac

How do I find (and kill) processes that listen to/use my TCP ports? I'm on macOS. Sometimes, after a crash or some bug, my Rails app is locking port 3000. I can't find it using ps -ef... When running rails server I get Address already in use -…
oma
  • 38,642
  • 11
  • 71
  • 99
1995
votes
35 answers

What is the difference between a process and a thread?

What is the technical difference between a process and a thread? I get the feeling a word like 'process' is overused and there are also hardware and software threads. How about light-weight processes in languages like Erlang? Is there a definitive…
James Fassett
  • 40,306
  • 11
  • 38
  • 43
969
votes
7 answers

How do I get the application exit code from a Windows command line?

I am running a program and want to see what its return code is (since it returns different codes based on different errors). I know in Bash I can do this by running echo $? What do I do when using cmd.exe on Windows?
Skrud
  • 11,604
  • 5
  • 24
  • 22
883
votes
31 answers

How can I measure the actual memory usage of an application or process?

How do you measure the memory usage of an application or process in Linux? From the blog article of Understanding memory usage on Linux, ps is not an accurate tool to use for this intent. Why ps is "wrong" Depending on how you look at it, ps is not…
ksuralta
  • 16,276
  • 16
  • 38
  • 36
801
votes
13 answers

What killed my process and why?

My application runs as a background process on Linux. It is currently started at the command line in a Terminal window. Recently a user was executing the application for a while and it died mysteriously. The text: Killed was on the terminal. This…
sbq
  • 8,049
  • 3
  • 17
  • 5
792
votes
14 answers

Xcode process launch failed: Security

I have been developing an app for 1 or 2 weeks now and just yesterday I have updated my iPhone 5S to the iOS 8 GM. Everything worked fine and I could test on my device as well until I deleted the app from my phone and wanted to build again. The…
Tom Spee
  • 9,209
  • 5
  • 31
  • 49
741
votes
35 answers

How to wait in bash for several subprocesses to finish, and return exit code !=0 when any subprocess ends with code !=0?

How to wait in a bash script for several subprocesses spawned from that script to finish, and then return exit code !=0 when any of the subprocesses ends with code !=0? Simple script: #!/bin/bash for i in `seq 0 9`; do doCalculations $i…
tkokoszka
  • 11,647
  • 10
  • 30
  • 25
651
votes
30 answers

How do I run a node.js app as a background service?

Since this post has gotten a lot of attention over the years, I've listed the top solutions per platform at the bottom of this post. Original post: I want my node.js server to run in the background, i.e.: when I close my terminal I want my server…
Peter Kruithof
  • 10,584
  • 6
  • 29
  • 42
587
votes
12 answers

How do I execute a command and get the output of the command within C++ using POSIX?

I am looking for a way to get the output of a command when it is run from within a C++ program. I have looked at using the system() function, but that will just execute a command. Here's an example of what I'm looking for: std::string result =…
Misha M
  • 10,979
  • 17
  • 53
  • 65
459
votes
34 answers

What's the best way to send a signal to all members of a process group?

I want to kill a whole process tree. What is the best way to do this using any common scripting languages? I am looking for a simple solution.
Adam Peck
  • 6,930
  • 3
  • 23
  • 27
425
votes
69 answers

Visual Studio "Could not copy" .... during build

I keep getting this error during the build of my VS2012 C# project Error 41 Could not copy "obj\Debug\WeinGartner.WeinCad.exe" to "bin\Debug\WeinGartner.WeinCad.exe". Exceeded retry count of 10. Failed. Error 42 Unable to copy file…
bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
399
votes
10 answers

Start a background process in Python

I'm trying to port a shell script to the much more readable python version. The original shell script starts several processes (utilities, monitors, etc.) in the background with "&". How can I achieve the same effect in python? I'd like these…
Artem
  • 6,420
  • 6
  • 26
  • 26
365
votes
10 answers

127 Return code from $?

What is the meaning of return value 127 from $? in UNIX.
Sachin
  • 20,805
  • 32
  • 86
  • 99
361
votes
8 answers

How to get the start time of a long-running Linux process?

Is it possible to get the start time of an old running process? It seems that ps will report the date (not the time) if it wasn't started today, and only the year if it wasn't started this year. Is the precision lost forever for old processes?
ajwood
  • 18,227
  • 15
  • 61
  • 104
354
votes
11 answers

What is a "thread" (really)?

I have been trying to find a good definition, and get an understanding, of what a thread really is. It seems that I must be missing something obvious, but every time I read about what a thread is, it's almost a circular definition, a la "a thread is…
richard
  • 12,263
  • 23
  • 95
  • 151
1
2 3
99 100