- 博客(5)
- 收藏
- 关注
原创 kfifo 用户空间实现
#ifndef _Linux_KFIFO_H#define _Linux_KFIFO_H#define __u32 unsigned long#define __u64 unsigned long long#define min(x,y) (x < y ? x : y )#define max(x,y) (x > y ? x : y )/*static inline int f
2014-06-19 12:22:16 1396
原创 单生产者,单消费者无锁队列实现(c)
根据上面链接所说的原理实现的单生产者,单消费者无锁队列bool __sync_bool_compare_and_swap (type *ptr, type oldval,type newval, ...)函数提供原子的比较和交换,如果*ptr == oldval,就将newval写入*ptr。队列头文件/* * * Copyright (c) * * All righ
2014-06-14 12:20:58 3411 3
转载 buff分析
1. 位置使用时包含头文件:#include "buffer.h"2. 数据结构2.1. struct bufferstruct buffer?1234567891011/* 缓存头 */struct buffer{ struct buffer_bucket *head; /* 指向第一个
2014-06-04 23:13:06 1329
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人