OS - Process (Main Thread) / Program

About

A process is the first thread started (called the main thread). It's the only thread that is authorized to start a new threads.

A process is a unit of resources, while a thread is a unit of:

A process is also known as:

  • a task (ie Task Manager).
  • running programs

Creating or destroying a process is relatively expensive, as resources must be acquired or released.

Processes are often seen as synonymous with programs or applications. However, what the user sees as a single application may in fact be a set of cooperating processes (ie a system)

OS

Process in a OS context

Management

Creation

A process is an instance of a executable file created via a command.

Processor

Which processor are allowed to run the process ? See Hardware - NUMA node (Affinity)

Id

Process Id (PID)

State

Process / Thread - State

Process States

Environment

See Process / Thread - Environment Variable

Time

Process time are CPU time

Communication

Vizualization

https://github.com/epickrram/grav/blob/master/README.md

Watch Dog

Process - Watch Dog

Monitoring

strace

OS - strace (Interactions between processes and the Linux kernel)

To start and monitor an new process:

strace -f -e trace=network -s 10000 PROCESS ARGUMENTS

To monitor an existing process with a known PID:

strace -p $PID -f -e trace=network -s 10000

Call Stack

There is usually exactly one call stack associated with a running process (or thread)

Priority

in Process Explorer

The priority of a web server:

Process Priority Process Explorer

where:

Kill

Windows and wmic

wmic process where CommandLine like '%${project.artifactId}%' and not name='wmic.exe' delete
REM or
wmic PROCESS WHERE NAME="CALC.EXE" DELETE

Thread

A process may start zero or many threads.

Example: in Process Explorer

Process Thread Relationship Process Explorer

Documentation / Reference

Task Runner