摘要: 1 $size = 1024*1024; 2 3 $shm_key = ftok(__FILE__, 't'); 4 5 $shm_id = shmop_open($shm_key, "c", 0644, $size); 6 7 $id = sem_get($shm_key); 8 9 $data = shmop_read($shm_id, 0, $size); 10 ... 阅读全文
posted @ 2018-04-07 21:26 狂猫 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1 if (!function_exists('sem_get')) { 2 function sem_get($key) { 3 return fopen(__FILE__ . '.sem.' . $key, 'w+'); 4 } 5 function sem_acquire($sem_id) { 6 return flock... 阅读全文
posted @ 2018-04-07 21:24 狂猫 阅读(245) 评论(0) 推荐(0) 编辑