Linux inter-process communication (IPC) Programming Practice (2) FIFO naming Pipeline
In the previous article, we explained how to use anonymous pipelines to transmit data between processes, and also saw a defect in this method, these processes are started by a common ancestor process, which makes it inconvenient for us to exchange data between unrelated processes. Here, we will introduce another communicat
Heartbeat introduction Heartbeat practice test havailability cluster (HA cluster for short. It is common.
Heartbeat introduction
Heartbeat test
Http://hi.baidu.com/%BB%C6%D0%C4%B2%A8/blog/item/d120a74da0e7fd38afc3ab09.html
Heartbeat principle
Cluster systems are mainly divided into High Availability clusters (HA clusters. Generally, HA clusters made by two nodes have many unscientific names, such as "dual-machine hot backup", "dual-machine mutual back
, blocking mode), if the length of the data being written is less than the waiting pipe_buf, either all bytes are written, or none of the bytes are written. If all of the write requests are destined for a blocking FIFO, and the data length of each write request is less than or equal to Pipe_buf bytes, the system ensures that the data will never be interleaved. (Refer to my previous blog post). Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reprodu
A way of communication between humans and computers.C language is suitable for Linux embedded. Gadgets.The Mac computer is the UNIX kernel.Second, the basic operation of Linux#vi A.C New File#rm A.C Delete FilesI current cursor before insertionA is inserted after the current cursorShift+a Line End InsertionShift+i Line Header Insertiono Insert Next lineShift+o the previous line insertsDD deletes the cursor
Linux inter-process communication (IPC) Programming Practice (iii) Details System V Message Queue (1)Message Queue introduction Message Queue provides a method for sending a piece of data (local) from one process to another. Each data block is considered to be of a type, the data blocks received by the recipient process can have different types of values. Message queues have the same limitations as pipeline
struct body of the Structled_classdev type we want to register myled.name=pdata->name;// The name of the LED device on the current match myled.brightness=255;myled.brightness_set=whyx210_led1_set;// This myled Brightness_set method binding can not actually be fixed whyx210_led1_set this method, because we // The driver and equipment matching is not fixed is led1, it is possible that the LED2 device is also matched with this driver, the total can not led2 //How to use the method of led1//To
situation, when a thread ends, the system resources it consumes are not released, that is, there is no real termination. only when the Pthread_join () function returns does the created thread release the system resources that it occupies . In the case of detached attributes, the system resources that it occupies are released immediately at the end of a thread. one thing to note here is that if you set the Detach property of a thread, and the thread runs very fast, it is likely to terminate befo
Linux Process understanding and practice (2) zombie and orphan processes and file sharingOrphan process and zombie process orphan process: if the parent process exits first and the child process has not exited, the parent process of the child process will become the init process. (Note: Any process must have a parent process)
# Include
Zombie process: if the child process exits first and the parent process
pthread_setspecific bound thread 2, at which time thread 1 calls pthread_getspecific returns the key_t bound TSD pointer, which is still a TSD pointer to thread 1, even though key_t There is only one, but each thread has its own TSD.Specific data. With the key-value Implementation, a thread creates a keyand other threads are created. but not the same fast memory pointing to. They point to their own data.This is thread-specific data.In the above code, even Sleeep (2), thread 1 's data is not a
another host. It can be used with the default settings by just specifying a hostname (e.g. ping raspberrypi.org ) or an IP address (e.g. ping 8.8.8.8 ). It can specify the number of packets to send with the -c flag.Nmapnmapis a network exploration and scanning tool. It can return port and OS information about a host or a range of hosts. Running just would display the options available as well as nmap example usage.HOSTNAMEThe hostname command displays the current hostname of the system. A privi
EXECVP start a new program in the program:To create a new process with fork:Forkdemo2 Code:When testing the fork, refer to the Linux authoritative guide reading notes (3) using patches:[Email protected] programming]#diff-C forkdemo2.c forkdemo2_new.c > Forkdemo2.Patch[email protected] programming]#PatchPatchPatchingfileForkdemo2.c[[email protected] programming]#ls-Lrttotal7-rwxrwxrwx1Root root4953Sep6 One: toForkdemo2-rwxrwxrwx1Root root4957Sep6 One
max=65535 inactive=20s; #max指定缓存数量, the recommended number of open files is the same, inactive refers to how long the file has not been requested to delete the cache. open_file_cache_valid 30s; #指多长时间检查一次缓存的有效信息open_file_cache_min_uses 1; #open_file_cache指令中的inactive参数时间内文件的最少使用次数, if this number is exceeded, the file descriptor is always opened in the cache, as in the previous example, If a file is not used once within inactive time, it will be removed. Server_tokens off; #关闭错误时Nginx版本显示#提高文件传
1, summarize the text editing tool vim use method;2, summarize the document Search command find use method;3, summarize the content of bash environment variable;4. Summarize the knowledge points of special permissions (SUID, SGID, Sticky) on Linux file system;5, summarize the Linux Disk Management, file system related knowledge points and the use of related commands;6, copy the/etc/grub.cfg configuration fi
Sem_open (key_t key) { int semid = Semget ( Key, 0, 0); if (Semid = =-1) err_exit ("Sem_open error"); return semid;}Shmctlint semctl (int semid, int semnum, int cmd, ...);Control semaphore SetParametersSEMID: Signal set identification code returned by Semget semnum: sequence number of signals in the signal set (note: Starting from 0 The semaphores in a set is numbered starting at 0.) cmd: The action to be taken (common values are as follows) If the function requires a fourth arg
; /* Band event (is int in GLIBC 2.3.2 and earlier) */int si_fd; /* File Descriptor */short SI_ADDR_LSB; /* Least significant bit of address (since Linux 2.6.32) */}Sigqueue
#include FunctionSigqueue is a new signaling signalling system called, mainly for real-time signal support signal with parameters , and function sigaction () with the use.One more parameter than the KILL function:Const Union sigval value (
=unknown", "Path=/tmp", NULL}; Execve ("./echoall", args,env); } wait (NULL); PID = fork (); if (PID = =-1) err_exit ("fork Error"); else if (PID = = 0) {//Example EXECLP EXECLP ("./echoall", "Echoall", "Only one arg", NULL); } wait (NULL); return 0;} Echoallint Main (int argc, char *argv[]) {for (int i = 0; i system CallSystem () function Call "/bin/sh-c Command" executes a specific command that blocks the current process until Command Command Execution Complete , the system w
, [], [[]], (()):650) this.width=650; "Width=" "height=" 98 "title=" 2.png "style=" width:600px;height:98px;float:left; "alt=" Wkiom1kama_rp_flaabakvhuvvm588.png "src=" Https://s4.51cto.com/wyfs02/M02/92/80/wKiom1kAMA_Rp_ Flaabakvhuvvm588.png "border=" 0 "vspace=" 0 "hspace=" 0 "/>
Above for I read "with the old boy learn Linux Yun Koriyuki Shell programming Combat" This book when the note, if there are any copyright issues, please contact the m
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.