One, wait, and WAITPID functionsA SIGCHLD signal is sent to the parent process when a process is normal or abnormally terminated. For this signal system is ignored by default. The process that calls Wait/waidpid may:
Blocking (if its child
One, process identificationEach process has a unique process ID that is represented by a nonnegative integer. Although the ID is unique, the process ID is reusable. When a process terminates, its process ID becomes a candidate for reuse.There are
Description of the processIn layman's words, a process is a program or code that is being executed. We know that the program itself is a bunch of code, at the beginning of the storage on disk, it is static, lifeless, only when the code of the
Principle Analysis:A mutex is a system kernel object that each thread can own, and who owns it can executeAfter execution, use the ReleaseMutex function to release ownership so that other waiting threads can use theOther threads can queue up with
1. What is a zombie processIf the parent process terminates before the child process, all the parent processes of the child processes will be changed to the INIT process, which we call the INIT process adopted. You can see that the parent process of
1. Signals are soft interrupts that provide a mechanism for handling asynchronous eventsAn asynchronous event can originate from outside the system (for example, user input ctrl-c) or from within the system (for example, except 0) the kernel uses
Thread StateDuring the lifetime of a thread , it is possible to convert between multiple states. Different operating systems can implement different threading models, defining many different thread states, each of whichThe State can also contain
the difference between Epoll and Select/pollThe select,poll,epoll is a mechanism for IO multiplexing. I/O multiplexing is a mechanism by which multiple descriptors can be monitored, and once a descriptor is ready, the program can be notified of the
11, Process creationLinux process creation can be divided into two steps, the fork () and the Exec () function, fork () is responsible for creating a child process, and the parent process is only the PID ppid and some statistics, the EXEC ()
1. Linux Multithreading Overview 1.1. OverviewProcess is the basic unit of program execution and resource allocation in the system. Each process has its own data segments, code snippets, and stack segments. This causes the process to switch
Original URL: http://my.oschina.net/laopiao/blog/947281. Using Global variables (form not applicable)There are many ways to implement inter-thread communication, which is mainly implemented by global variables, custom messages and event objects. The
One, wait () functionWhen you call the Wait () function in a process(1) If all of its subroutines are still being executed, the blockage(2) Assume that a child process has been terminated. Waits for the parent process to get its terminating state.(3)
1, the static characteristics of the processProcess: an instance of program executionProcess Descriptor (TASK_STRUCT): basic information for the process (thread_info), pointer to memory area descriptor (MM_STRUCT), process-related TTY (tty_struct),
11.3 Starting a new process canstart another program inside the program to create a new process. This work can be done through the library function systemYes.#include int system (const char *string);the function of the system function is to run the
One, wait () functionWhen you call the Wait () function in a process(1) If all of its subroutines are still running, block(2) If a child process is terminated, wait for the parent process to get its terminating state.(3) If there are no child
Process Communication
Memory sharingA process Create shared area shmget (...) map memory share Shmat (...)The B process finds the shared area by key to map the memory shareInter-process communicationRevoke the respective memory mappings
1Linux Process OverviewThe process is that once the program runs, he and the program are essentially different. The program is static, and he is instructed to collect instructions stored on disk. The process is a dynamic concept. He is the executor
C + + Supplements-Multithreading: the introduction of multithreadingObjectiveMultithreading is an important part of programming. Multi-core era makes multithreading known as a possibility, obviously, one thing many people do, efficiency will
In the development of Linux driver, the delay function is often used: Msleep,mdelay/udelay.Although both Msleep and mdelay have delayed effects, they are different.1.) for the module itselfMdelay is a busy wait function and cannot run other tasks
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.