Linux General Concepts: Difference between revisions
Line 36: | Line 36: | ||
{{Internal|Linux Namespaces|Linux Namespaces}} | {{Internal|Linux Namespaces|Linux Namespaces}} | ||
=File Descriptor= | |||
A ''file descriptor'' is a non-negative integer used internally by a process to identity and access a file and other input/output resource such as a pipe or a network socket. File descriptors are part of the POSIX application programming interface. Each process should expect to have three standard POSIX file descriptors, corresponding to the three standard streams: | |||
* standard input (stdin), whose file descriptor is 0. | |||
* standard output (stdout), whose file descriptor is 1. | |||
* standard error (stderr), whose file descriptor is 2. |
Revision as of 15:18, 3 May 2017
Internal
Processes
A process is an operating system level construct that holds all the resources an application maintains and uses at runtime. These resources include, but are not limited to a memory address space, file handles, devices and threads. teach process contains at least one thread, and the initial thread for the process is called the main thread. When the main thread terminates, the application terminates.
Signals
Sockets
Unix domain sockets are bidirectional communication mechanisms that allow processes running within the same host operation system to exchange data. IP (network) sockets are bidirectional communication mechanisms allowing processes running on different hosts to exchange data over the network. Because of simplifying assumptions, UNIX sockets are faster and lighter, so they should be preferred over network sockets when we are sure the process are collocated. UNIX and network sockets share the API. They are subject to filesystem permissions. More details: https://en.wikipedia.org/wiki/Unix_domain_socket, https://en.wikipedia.org/wiki/Network_socket.
The /sys Filesystem
Threads
The operating system schedules the threads to run against physical (or virtual) processors.
Pseudo tty
With the first terminals, there was always a piece of hardware (display or serial port) attached to the device. With XWindows, telnet and ssh, there came a need for software pseudo devices to do the job of standing in for display hardware. These are the pseudo terminals, software that emulates terminal hardware, handling input and output in the same way a physical device would do.
cgroups
Namespaces
File Descriptor
A file descriptor is a non-negative integer used internally by a process to identity and access a file and other input/output resource such as a pipe or a network socket. File descriptors are part of the POSIX application programming interface. Each process should expect to have three standard POSIX file descriptors, corresponding to the three standard streams:
- standard input (stdin), whose file descriptor is 0.
- standard output (stdout), whose file descriptor is 1.
- standard error (stderr), whose file descriptor is 2.