컴퓨터 공부/Advanced UNIX System Programming 29

[5월 12일 2교시] 시스템V IPC - 공유메모리, 쓰레드

공유메모리 프로세스 간에 공유 메모리를 설정하여 커널 버퍼 경유를 없앰. 동기화 방법 필요(메모리를 계속 읽을 경우 CPU 오버헤드가 심함) #include<sys/types.h> #include<sys/ipc.h> #include<sys/shm.h> int shmget(key_t key, int size, int shmflag); key값과 관련된 공유 메모리 세그먼트(size만큼)의 식별자를 리턴한다. s..

[5월 11일 2교시] 시스템V IPC - 메세지큐

스트림 : 연속된 바이트들의 흐름(바이트 단위) 메세지 : 레코드 단위의 데이터 전송(format 존재) 시스템 V IPC  - 메세지 큐  - 세마포어(동기화)  - 공유메모리 인터페이스를 위한 별도의 함수 존재 동일한 namespace(input용)로 key를 이용, 식별자는 ID로 한다. Key(키) #include<sys/types.h> #include<sys/ipc.h> key..

[5월 8일 1교시] 입출력 다중화 1

다수의 blocking file descriptor를 번갈아가며 처리 불가. 해결책  - 모든 디스크립터를 nonblocking으로 설정한 뒤 전부 검사(polling)  - 비동기 입출력을 선택적으로 결합  - 입출력 다중화 함수를 사용 - select, poll함수 select함수 #include<sys/types.h> #include<sys/time.h> #include<unistd.h> int select(__in int maxfdp1,__inou..