F多进程间通讯 共享内存
Linux下进程间通信--共享内存:最快的进程间通信方式
https://www.cnblogs.com/melons/p/5791787.html
http://www.cnblogs.com/xuhj001/p/3372888.html
低级通信主要用于进程之间的同步、互斥、终止、挂起等等控制信息的传递。
高级通信主要用于进程间数据块的交换和共享 常见的高级通信有管道(PIPE)、消息队列(MESSAGE)、共享内存(SHARED MEM0RY)等。
linux中进程共享内存的2种方法
https://blog.csdn.net/shenyuflying/article/details/53244917
shmat / mmap
mmap详解
https://blog.csdn.net/l534145398/article/details/53283808
memcpy/strcpy
https://blog.csdn.net/sszgg2006/article/details/7989404
mlock
$ more /proc/sys/vm/max_map_count
65530
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1029535
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 1029535
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
$ ulimit -S -l 32
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 1029535
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 1029535
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
管道 pipe
linux 管道读写规则
https://blog.csdn.net/nodeathphoenix/article/details/23284157
--非阻塞
int flags = fcntl(fds[0], F_GETFL);//先获取原先的flags
fcntl(fds[0],F_SETFL,flags | O_NONBLOCK);//设置fd为阻塞模式
多进程锁/多线程锁mutex
linux-使用互斥锁完成多进程同步(多进程/多线程锁)
http://deepfuture.iteye.com/blog/760860
https://blog.csdn.net/g_brightboy/article/details/6865995
Linux编程练习(一)—— 多线程+共享内存+线程信号量练习
https://www.linuxidc.com/Linux/2013-11/93009.htm
https://blog.csdn.net/lfw19891101/article/details/5994927