揮発性のメモ2

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

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

sem_open

名前付きセマフォを使ったプロセス間での排他制御 // gcc -Wall -lpthread test_sem.c // 動かんときは rm /dev/shm/sem.unko #include <fcntl.h> // O_CREAT #include <semaphore.h> // sem_wait #include <stdio.h> // printf #include <unistd.h> // sleep int main() { // 1を指定するとバイナリセ</unistd.h></stdio.h></semaphore.h></fcntl.h>…