锘??xml version="1.0" encoding="utf-8" standalone="yes"?>伊人久久亚洲综合,精品国产日韩亚洲一区,久久亚洲春色中文字幕久久久http://www.tkk7.com/clraychen/category/20064.htmlzh-cnWed, 14 Mar 2007 03:43:33 GMTWed, 14 Mar 2007 03:43:33 GMT60linux 鏇存柊http://www.tkk7.com/clraychen/archive/2007/02/15/99891.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Wed, 14 Feb 2007 17:43:00 GMThttp://www.tkk7.com/clraychen/archive/2007/02/15/99891.htmlhttp://www.tkk7.com/clraychen/comments/99891.htmlhttp://www.tkk7.com/clraychen/archive/2007/02/15/99891.html#Feedback0http://www.tkk7.com/clraychen/comments/commentRss/99891.htmlhttp://www.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://www.tkk7.com/clraychen/archive/2006/06/20/54085.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Tue, 20 Jun 2006 15:42:00 GMThttp://www.tkk7.com/clraychen/archive/2006/06/20/54085.htmlhttp://www.tkk7.com/clraychen/comments/54085.htmlhttp://www.tkk7.com/clraychen/archive/2006/06/20/54085.html#Feedback0http://www.tkk7.com/clraychen/comments/commentRss/54085.htmlhttp://www.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://www.tkk7.com/clraychen/archive/2006/06/14/52836.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Wed, 14 Jun 2006 12:14:00 GMThttp://www.tkk7.com/clraychen/archive/2006/06/14/52836.htmlhttp://www.tkk7.com/clraychen/comments/52836.htmlhttp://www.tkk7.com/clraychen/archive/2006/06/14/52836.html#Feedback0http://www.tkk7.com/clraychen/comments/commentRss/52836.htmlhttp://www.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://www.tkk7.com/clraychen/archive/2006/06/14/52835.html紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/dc:creator>紱誨雞涔媟ay鐨勬妧鏈ぉ絀?/author>Wed, 14 Jun 2006 12:07:00 GMThttp://www.tkk7.com/clraychen/archive/2006/06/14/52835.htmlhttp://www.tkk7.com/clraychen/comments/52835.htmlhttp://www.tkk7.com/clraychen/archive/2006/06/14/52835.html#Feedback0http://www.tkk7.com/clraychen/comments/commentRss/52835.htmlhttp://www.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



]]>
主站蜘蛛池模板: 女人被弄到高潮的免费视频| 毛片在线播放免费观看| 免费A级毛片无码免费视| 99ri精品国产亚洲| 久久九九AV免费精品| 亚洲视频免费在线播放| 免费观看美女用震蛋喷水的视频| 亚洲成在人天堂在线| 久久这里只精品国产免费10| 亚洲福利在线观看| 免费观看激色视频网站(性色)| 亚洲伊人久久大香线蕉影院| 成年网站免费视频A在线双飞| 亚洲私人无码综合久久网| 成人永久免费福利视频网站| 日日摸夜夜添夜夜免费视频| 国产亚洲一区二区三区在线不卡 | 免费91麻豆精品国产自产在线观看| 亚洲国产精品一区二区第一页| 久久免费动漫品精老司机| 国产成人精品日本亚洲直接 | 中国在线观看免费国语版| 亚洲国产精品自在自线观看| 全黄性性激高免费视频| 好紧我太爽了视频免费国产| 亚洲综合激情九月婷婷 | 亚洲AV成人潮喷综合网| 中文字幕在线视频免费| 亚洲精品自在线拍| 国产美女无遮挡免费网站| 中文字字幕在线高清免费电影| 久久亚洲AV成人无码国产| 精品国产免费观看一区| 你好老叔电影观看免费| 亚洲国产模特在线播放| 日批日出水久久亚洲精品tv| 久爱免费观看在线网站| 日本亚洲中午字幕乱码| 亚洲一区二区在线免费观看| 国产在线19禁免费观看国产| 伊人久久免费视频|