锘??xml version="1.0" encoding="utf-8" standalone="yes"?>伊人久久亚洲综合,精品国产日韩亚洲一区,久久亚洲春色中文字幕久久久http://m.tkk7.com/clraychen/category/20064.htmlzh-cnWed, 14 Mar 2007 03:43:33 GMTWed, 14 Mar 2007 03:43:33 GMT60linux 鏇存柊http://m.tkk7.com/clraychen/archive/2007/02/15/99891.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Wed, 14 Feb 2007 17:43:00 GMThttp://m.tkk7.com/clraychen/archive/2007/02/15/99891.htmlhttp://m.tkk7.com/clraychen/comments/99891.htmlhttp://m.tkk7.com/clraychen/archive/2007/02/15/99891.html#Feedback0http://m.tkk7.com/clraychen/comments/commentRss/99891.htmlhttp://m.tkk7.com/clraychen/services/trackbacks/99891.html聽聽聽 紿佺劧鎶ュ嚭鏈?40涓蔣浠跺寘鍙互鏇存柊錛屽師鏉ユ槸鑷姩鏇存柊鍦ㄤ綔鎬?br />
聽聽聽 鐒跺悗灝遍『鐞嗘垚绔犲湴鐐瑰惂錛岃繕鎸洪『鍒╋紝瀹冨氨寮濮嬫洿鏂頒簡銆備絾鏇存柊鐫灝卞湪閭d笉鍔ㄤ簡錛屽鎱㈡棤姣斻?br />
聽聽聽 鍦ㄨ佸﹩鐨勬寚瀵間笅錛屾垜涓婄綉鏌ヤ簡涓涓媦um鐨勭敤娉曘?br />
聽聽聽 鎵撳紑緇堢銆?br />聽聽聽 棣栧厛浣跨敤yum list鏉ユ煡鐪嬫洿鏂板垪琛紝鍒風殑涓涓嬪嚭鏉ュソ澶氥?br />聽聽聽 鐒跺悗浣跨敤yum update錛屽畠浼氭鏌ユ瘡涓鏇存柊鐨勮蔣浠跺寘鐨勫ご錛屽緱鍒頒竴浜涗俊鎭紝鍖呮嫭杞歡鍖呯殑澶у皬絳夌瓑銆?br />
聽聽聽 浼氳綆楀嚭鎬葷殑瑕佷笅杞界殑澶у皬錛岄棶浣犳槸鍚﹁涓嬭澆銆?br />聽聽聽 涔栦箹錛屼竴鍏?90m錛?鎴戦夋嫨浜唝錛屽紑濮嬩笅杞解︹?br />
聽聽聽 婕暱鐨勭瓑寰呫?br />聽聽聽 鐒跺悗浼氭彁紺轟綘錛屼綘鍐嶉夋嫨y紜畾涓涓嬪氨濂姐?br />聽聽聽 寮勫畬鍚庡崐姝伙紝閲嶅惎涓涓嬪悗涓鍒囨甯搞?br />
聽聽聽 浣嗛噸鍚椂鍙戠幇錛屽惎鍔ㄦ椂閫夋嫨緋葷粺鐨勬椂鍊檒inux鏈変簡涓や釜閫夐」錛屽彧鏈夌増鏈俊鎭殑寰皬宸紓銆傚掓槸涓嶅獎鍝嶄綘閫夋嫨榪涘叆linux
聽聽聽 灝辨槸鐪嬪緱涓嶆槸寰堢埥銆備簬鏄笂緗戞悳绱簡涓涓嬶紝鐭ラ亾榪欎釜淇℃伅鐢?鏂囦歡緋葷粺/boot/grub/grub.conf鏉ュ喅瀹氥?br />聽聽聽 浜庢槸鐮旂┒浜嗕竴涓嬪畠錛屽垹鎺変簡閭d釜鐗堟湰姣旇緝鏃х殑閫夐」錛屽啀鎶婇粯璁ゅ惎鍔ㄧ郴緇熸敼涓篸efault = 1 錛堝洜涓虹幇鍦ㄦ槸涓や釜浠?寮濮嬬紪鍙鳳紝windows鏄?錛屼竴寮濮嬩笁涓殑鏃跺欙紝windows鏄?錛?br />
聽聽聽聽 鑷蟲錛屾洿鏂板交搴曞畬鎴愶紒

]]>
FIFOhttp://m.tkk7.com/clraychen/archive/2006/06/20/54085.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Tue, 20 Jun 2006 15:42:00 GMThttp://m.tkk7.com/clraychen/archive/2006/06/20/54085.htmlhttp://m.tkk7.com/clraychen/comments/54085.htmlhttp://m.tkk7.com/clraychen/archive/2006/06/20/54085.html#Feedback0http://m.tkk7.com/clraychen/comments/commentRss/54085.htmlhttp://m.tkk7.com/clraychen/services/trackbacks/54085.htmlA FIFO is similar to a pipe. A FIFO is a one-way flow of data (First In First Out). FIFOs have a name, so unrelated processes can share the FIFO. FIFO is a named pipe.

FIFO鍜孭IPE鍩烘湰宸笉澶氾紝浣咶IFO鏄懡鍚嶇殑錛屼竴浜涙病鏈変翰緙樺叧緋葷殑process鑳藉叡浜畠銆?br />

Normally, opening a FIFO for read or write, it blocks until another process opens it for write or read. Write and read蹇呴』涓涓瀵瑰簲銆?br />

A read gets as much data as it requests or as much data as the FIFO has, whichever is less.

A write to a FIFO is atomic, as long as the write does not exceed the capacity of the FIFO. The capacity is at least 4k.


How to set flags.

writefd = open (FIFO1, O_WRONLY|O_ONOBLOCK,0);

浣嗘槸pipe娌℃湁open鍑芥暟

鎵浠ュ彧鑳借繖鏍瘋瀹?/span>

flags= fcntl (fd, F_GETFL,0);

flag|=O_NONBLOCK;

fcntl =(fd,F_SETFL,flags);


涓嬮潰鐨勮〃寰堥噸瑕侊紝瑕佺湅娓呬笅闈㈢殑鍓嶆彁鎿嶄綔鍜屽綋鍓嶆搷浣滐紝涓昏姣旇緝浜咮locking鍜孫_NONBLOCK鏉′歡涓嬬殑鍖哄埆

Operation

Existing opens of pipe or FIFO

Blocking (default)

O_NONBLOCK set

Open FIFO for reading

FIFO open for writing

Returns OK

Returns OK

FIFO not open for writing

Blocks until FIFO is opened for writing

Returns OK

Open FIFO for writing

FIFO open for reading

Returns OK

Returns OK

FIFO not open for reading

Blocks until FIFO is opened for reading

Returns an error of ENXIO

Read empty pipe or FIFO

Pipe or FIFO open for writing

Blocked until there is data or the pipe or FIFO is closed for writing

Return an error of EAGAIN

Pipe or FIFO not open for writing

Read returns 0 (EOF)

Read return 0 (EOF)

Write to pipe or FIFO

Pipe or FIFO open for reading

Return ok

Return ok

Pipe or FIFO is full

Blocked until space is available, then write data

Returns an error of EAGAIN

Pipe or FIFO not open for reading

SIGPIPE generated, write process terminated

Returns an error of EPIPE





]]>
Pipehttp://m.tkk7.com/clraychen/archive/2006/06/14/52836.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Wed, 14 Jun 2006 12:14:00 GMThttp://m.tkk7.com/clraychen/archive/2006/06/14/52836.htmlhttp://m.tkk7.com/clraychen/comments/52836.htmlhttp://m.tkk7.com/clraychen/archive/2006/06/14/52836.html#Feedback0http://m.tkk7.com/clraychen/comments/commentRss/52836.htmlhttp://m.tkk7.com/clraychen/services/trackbacks/52836.html 鐖惰繘紼嬪拰瀛愯繘紼嬪垱寤哄弻鍚戠閬撶殑瀹為檯姝ラ

鍒涘緩綆¢亾 1(fd1[0] 鍜?/span> fd1[1]) 鍜岀閬?/span> 2(fd2[0] 鍜?/span> fd2[1])

Fork

鐖惰繘紼嬪叧闂閬?/span> 1 鐨勮鍑虹錛?/span> fd1[0]錛?/span> [MS1]

鐖惰繘紼嬪叧闂閬?/span> 2 鐨勫啓鍏ョ錛?/span> fd2[1] 錛?/span>

瀛愯繘紼嬪叧闂閬?/span> 1 鐨勫啓鍏ョ錛?/span> fd1[1] 錛?/span>

瀛愯繘紼嬪叧闂閬?/span> 2 鐨勮鍑虹錛?/span> fd2[0] 錛?br />


涓嬮潰鏄ず渚嬬▼搴忥細

#include 鈥渦npipe.h鈥?/span>

void client(int, int) ,server(int, int);

int main(int argc, char* argv[])

{

聽聽聽聽聽聽 int pipe1[2],pipe[2];

pid_t childpid;

Pipe(pipe1);

Pipe(pipe2);

if((childpid=fork())==0)

{

聽聽聽聽聽聽 Close(pipe1[1])聽;

聽聽聽聽聽聽 Close(pipe2[0])聽;

聽聽聽聽聽聽 server(pipe1[0],pipe2[1])聽;

聽聽聽聽聽聽 exit(0)聽;

}

close(pipe1[0])聽;

close(pipe2[1])聽;

client(pipe2[0],pipe1[1])聽;

waitpid(childpid,NULL,0)聽;

exit(0)聽;

}

//////////////////client

void client(int readfd, int writefd)

{

聽聽聽聽聽聽 size_t len;

ssize_t n;

charbuff[MAXLINE];

fgets(buff,MAXLINET,stdin);

len = strlen(buff);

if(buff[len-1]==鈥橽n鈥?

聽聽聽聽聽聽 len--;

write(writefd,buff,len);

while((n=read(readfd,buff,MAXLINE))>0)

聽聽聽聽聽聽聽 write(STDOUT_FILENO,buff,n);

}

///////////////////server

void server(int readfd, int writefd)

{

聽聽聽聽聽聽 int fd;

聽聽聽聽聽聽 ssize_t n;

聽聽聽聽聽聽 char buff[MAXLINE+1];

聽聽聽聽聽聽 if((n=read(readfd,buff,MAXLINE))==0)

聽聽聽聽聽聽聽聽聽 err_quit(鈥渆nd-of 鈥揻ile while reading pathname鈥?;

聽聽聽聽聽聽 if((fd =open(buff,O_RDONLY)<0)){

sprintf(buff+n,sizeof(buff)-n,鈥漜an鈥檛 open, %s\n鈥?strerror(errno));

n = strlen(buff);

write(writefd,buff,n);

}else{

While((n=read(fd,buff,MAXLINE))>0)

聽聽聽聽聽聽聽 Write(writefd,buff,n);

Close(fd);

}

}


Properties of Pipe:

1) Pipes do not have a name. For this reason, the processes must share a parent process. This is the main drawback to pipes. However, pipes are treated as file descriptors, so the pipes remain open even after fork and exec.

2) Pipes do not distinguish between messages; they just read a fixed number of bytes. New line (\n) can be used to separate messages. A structure with a length field can be used for message containing binary data.

3) Pipes can also be used to get the output of a command or to provide input to a command


[MS1] 鎹㈠彞璇濊灝辨槸鐖惰繘紼嬪綆¢亾 1 鍙兘鍐欙紝浠ヤ笅鍙互渚濇綾繪帹銆?/span>



]]>
IPC鈥斺擨nterprocess Communicationhttp://m.tkk7.com/clraychen/archive/2006/06/14/52835.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Wed, 14 Jun 2006 12:07:00 GMThttp://m.tkk7.com/clraychen/archive/2006/06/14/52835.htmlhttp://m.tkk7.com/clraychen/comments/52835.htmlhttp://m.tkk7.com/clraychen/archive/2006/06/14/52835.html#Feedback0http://m.tkk7.com/clraychen/comments/commentRss/52835.htmlhttp://m.tkk7.com/clraychen/services/trackbacks/52835.html 瑕佽冭瘯鍟︼紝涓杈瑰涔狅紝涓杈硅褰曗︹?br />
IPC
鏈変袱涓姛鑳?/span> : Synchronization 鍜?/span> Message Passing 錛屽叾涓?/span> message Passing 鏈変笅闈㈠嚑縐嶅艦寮?/span> :Pipes, FIFOs, Message Queues, Shared Memory

File or Record Locking

int lockf (int fd, int function, long size) 鍏朵腑 fd 鏄枃浠舵弿榪扮 (file descripter) 錛?/span> size 鏄攣瀹氱殑澶у皬 [offset, offset+size] 錛屽鏋?/span> size=0, 灝辮〃紺烘枃浠朵綑涓嬬殑閮ㄥ垎銆傚彲浠ョ敤 lseek() 鍘葷Щ鍔ㄥ綋鍓嶇殑 offset 銆?/span> 鑰屽叾涓殑 function 鍙傛暟鏈変互涓嬪嚑縐嶏細 F_ULOCK, F_LOCK, F_TEST, F_TLOCK



]]>
主站蜘蛛池模板: 99久久亚洲综合精品成人网| 成人毛片免费观看视频在线| 亚洲欧洲精品成人久久奇米网| 亚洲日本在线电影| 免费电视剧在线观看| 亚洲人成电影网站久久| 91免费资源网站入口| 亚洲国产福利精品一区二区| 99久久综合精品免费| 亚洲精品在线视频观看| 亚洲免费网站在线观看| 亚洲一区二区三区精品视频 | 亚洲AⅤ永久无码精品AA| 国产成人亚洲午夜电影| 亚洲国模精品一区| 韩国免费a级作爱片无码| 亚洲精品成人片在线播放| 久久成人免费电影| 亚洲人成网站在线观看播放青青| 青娱乐免费视频在线观看| 亚洲精品理论电影在线观看| 国产成人3p视频免费观看| 亚洲免费视频一区二区三区| 亚洲人精品午夜射精日韩| 久久久久免费看黄a级试看| 亚洲一区二区三区精品视频| 在线免费观看韩国a视频| 一级毛片视频免费| 久久亚洲精品人成综合网| 人禽杂交18禁网站免费| 特a级免费高清黄色片| 亚洲avav天堂av在线不卡| 性生交片免费无码看人| 亚洲五月午夜免费在线视频| 亚洲日韩区在线电影| 韩国欧洲一级毛片免费 | 亚洲无吗在线视频| 亚洲一级特黄大片在线观看| 97精品免费视频| 国产精品亚洲一区二区三区久久| 亚洲中文字幕无码永久在线 |