- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 main.cpp
//main.cpp #include #include #include #include "global.h" using namespace std; int main(int argc, char **argv) { pthread_t *tids; int cnt = 0; int nProducers; int nConsumers;
2013-10-27 21:36:30 799
原创 makefile
objects = main.o blkConsumer.o blkProducer.o \ buffer.o global.o targets = parallel_copy .PHONY: all clean all: $(targets) parallel_copy: main.o blkConsumer.o blkProducer.o \
2013-10-27 21:31:54 468
原创 chengchanzhe
#include #include "global.h" using std::cout; using std::cerr; using std::endl; void *blkProducer(void *producerNum) { int count; int *nproducers = (int *)producerNum; for (;;) { //对互斥量buff
2013-10-27 21:22:48 458
原创 buffer.cpp
//对结构体buff_node进行初始化 void bufferInit(void) { head = (buff_node *)malloc(sizeof(buff_node)); head->node_id = 0; head->next = head; tail = head;//实现循环链表形式 return; }
2013-10-27 21:15:22 594
原创 global.cpp
#include "global.h" unsigned long blockIndex= 0; int fileFd; int bufferNum = BUFFNUM; buff_node *head; buff_node *tail; buff_node *temp; void bufferInit(void); void *blkProducer(void *); void *blkCons
2013-10-27 21:13:11 692
原创 global.h 源文件
#include #include #include #include #include #include #define MAXBLOCK 250 #define BUFFNUM 200 #define blockSize 16 #ifndef GLOBAL_HEADER_H #define GLOBAL_HEADER_H //定义三个全局变量 extern unsigned
2013-10-27 21:10:08 5379
原创 代码编辑器
#include #include "sizeofall.c" void main(int args, char *argv[]) { float size; size=sizeofall(argv[1], 6); printf("size is %.3f\n",size); }
2013-10-26 20:34:21 499
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人