揮発性のメモ2

http://d.hatena.ne.jp/iww/

2018-08-23から1日間の記事一覧

sem_init

共有メモリ上の名前なしセマフォを使ったプロセス間での排他制御 // gcc -Wall -lpthread test_seminit.c -lrt // 動かんときは rm /dev/shm/hoge #include <fcntl.h> // O_CREAT #include <semaphore.h> // sem_wait #include <stdio.h> // printf #include <unistd.h> // sleep #include <sys/mman.h> // mmap #i</sys/mman.h></unistd.h></stdio.h></semaphore.h></fcntl.h>…