SQL线程拷贝并发程序.docx

二、代码: #includestdio.h #includesys/types.h #includesys/stat.h #includefcntl.h #includeunistd.h #includepthread.h #includemalloc.h #define PSIZE 4096 /*管道文件的大小*/ #define BSIZE 512 /*默认缓冲区的大小*/ #define NOFILE 20 /*u_ofile3083表可分配的个数*/ #define NFILE 20 /*file表可分配的个数*/ #define NPIPE 20 /*pipecb3083可分配的个数*/ /*进程的u_file表*/ int u_ofile3083[NOFILE]; /*模拟file表*/ struct { char f_flag;/*读写标志,w表示写,r表示读*/ int f_count;/*表示此表项的状态,=0表示此表项没被使用,可分配;=1表示此表项在被使用,不可再分配*/ int f_inode;/*对应的pipecb3083表下标*/ long f_offset;/*读写指针,当前已读或已写个数*/ }file[NFILE]; /*管道控制块*/ struct { char *p_addr;/*管

文档评论(0)

1亿VIP精品文档

相关文档