Presentation is loading. Please wait.

Presentation is loading. Please wait.

Global array – 1M의 integer, P0.dat, P1.dat, P2.dat, P3.dat

Similar presentations


Presentation on theme: "Global array – 1M의 integer, P0.dat, P1.dat, P2.dat, P3.dat"— Presentation transcript:

1 Global array – 1M의 integer, P0.dat, P1.dat, P2.dat, P3.dat
2명 1조 발표 보고서 row_major column dist. block dist. 실행 결과 부족 ERROR 불가 8점 4점 6점 2점 3점 1명 1조 row_major column/block dist. 발표 보고서 실행 결과 부족 실행 불가 결과 부족 실행 불가 ERROR 실행 ERROR 3점 3점 12점 9점 6점 3점 12점 9점 6점 3점 Global array – 1M의 integer, P0.dat, P1.dat, P2.dat, P3.dat

2 시그널과 시그널 처리 SIGINT(Ctrl_C), SIGILL(illegal instruction), SIGTERM(termination) 한 프로세스는 시그널과 관련해서 Signal handling Signal Blocking Send signal to other process <signal.h>에 각 시그널이 정의 시그널 처리 Default ; 프로세스 종료 (SIGUSR1, SIGUSR2 – 시그널 무시) Ignore signal

3 시그널과 시그널 처리 시그널 집합 – sigset_t 시그널 초기화 sigaddset, sigdelset
Sigemptyset (모든 시그널 제거) Sigfillset (모든 시그널 포함) sigaddset, sigdelset Sigemptyset + sigaddset / sigfillset + sigdelset (P181)

4 시그널과 시그널 처리 Sigaction 시그널이 수신되기 전에 sigaction이 반드시 호촐
SIGSTOP, SIGKILL은 signal handling이 따로 정의될 수 없음 int sigaction(int signo, const struct sigaction *act, struct sigaction *oact) struct sigaction { void (*sa_handler)(int); //sighandler sigset_t sa_mask; // 봉쇄할 signal int sa_flags; // signo action 변경 void (*sa_sigaction)(int siginfo_t *, void *); }

5 시그널과 시그널 처리 Sigaction Signal handler 정의; 예제 (p184) SIGINT 무시; test2.c
복원 act.sa_handler = SIG_DFL; sigaction(SIGINT, &act, NULL); 이전 행동 복원 sigaction(SIGTERM, NULL, &oact); act.sa_handler = SIG_IGN; sigaction(SIGTERM, &act, NULL); ….. sigaction(SIGTERM, &oact, NULL);

6 시그널과 시그널 처리 Sigaction Signal handler 정의; 예제 (p184) SIGINT 무시; test2.c
복원 act.sa_handler = SIG_DFL; sigaction(SIGINT, &act, NULL); 이전 행동 복원 sigaction(SIGTERM, NULL, &oact); act.sa_handler = SIG_IGN; sigaction(SIGTERM, &act, NULL); ….. sigaction(SIGTERM, &oact, NULL);

7 시그널과 시그널 처리 sigsetjmp, siglongjmp
int sigsetjmp(sigjmp_buf env, savemask); void siglongjmp(sigjmp_buf env, int val); (예제 p191) if(sigsetjmp(position, 1) == 0) { act.sa_handler = goback; sigaction(SIGINT, &act, NULL); } domenu; void goback(void) { fprintf(stderr, “\n Interrupted\n”); siglongjmp(position, 1);

8 시그널과 시그널 처리 sigprocmask(int how, const sigset_t *set, sigset_t *oset)
sigset_t set1, set2; sigfillset(&set1); sigfillset(&set2); sigdelset(&set2, SIGINT); sigdelset(&set2, SIGQUIT); sigprocmask(SIG_SETMASK, &set1, NULL); sigprocmask(SIG_UNBLOCK, &set2, NULL); …. sigprocmask(SIG_UNBLOCK, &set1, NULL);


Download ppt "Global array – 1M의 integer, P0.dat, P1.dat, P2.dat, P3.dat"

Similar presentations


Ads by Google