//https://github.com/cloudwu/skynet/blob/master/skynet-src/rwlock.h
struct rwlock { 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

#include<stdio.h>
#include<pthread.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

#include<stdio.h>
#include<pthread.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

#include<stdio.h>
#include<pthread.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

#include <fcntl.h>
#include <sys/stat.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

#include <fcntl.h>
#include <sys/stat.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()

gcc testsync2.c -D_GNU_SOURCE  -march=native -lpthread -o testsync2.exe

//http://www.alexonlinux.com/

hedgezzz 發表在 痞客邦 留言(0) 人氣()

seqlock 實在是非常好用的概念 ,  假設你有兩個 threads ,

一個要寫入結構資料,一個要讀結構資料,此時,最常用的方法是 mutex or spin lock ,

hedgezzz 發表在 痞客邦 留言(0) 人氣()

http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue

 

hedgezzz 發表在 痞客邦 留言(0) 人氣()

//http://epaperpress.com/sortsearch/skl.html

#include <stdio.h>

hedgezzz 發表在 痞客邦 留言(0) 人氣()