1 / 5

foreground, background smallsh while (!EOF) { input command line; execute command; wait;

foreground, background smallsh while (!EOF) { input command line; execute command; wait; }. smallsh main (p153) userin (p146 ~ 147) procline  gettok (p149) runcommand(p152). 프로세스 식별번호 프로세스 0 – 스와퍼 ( 스케쥴러 ) 프로세스 1 – 초기화 프로세스 (init) getpid(), getppid()

hang
Download Presentation

foreground, background smallsh while (!EOF) { input command line; execute command; wait;

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. foreground, background • smallsh • while (!EOF) { • input command line; • execute command; • wait; • }

  2. smallsh • main (p153) • userin (p146 ~ 147) • procline  gettok (p149) • runcommand(p152)

  3. 프로세스 식별번호 • 프로세스 0 – 스와퍼 (스케쥴러) • 프로세스 1 – 초기화 프로세스 (init) • getpid(), getppid() • (예제) – p156 (test1.c) • (실습) – 연습문제 5.11 • fork와 exec를 사용함 (test2.c, gentemp.c)

  4. 프로세스 그룹과 프로세스 그룹 식별번호 • 그림 5.5 • 프로세스 그룹은 프로세스 그룹 식별번호에 의해 표시 • 한 프로세스가 프로세스 그룹 식별번호와 동일한 pid를 가지고 있으면 • 리더로 간주 • getgrp에 의해 프로세스 그룹 식별번호를 획득 • int setpgid(pid_t pid, pid_t pgid) • - 식별번호가 pid인 프로세스의 그룹 식별자를 pgid로 설정 • - pid가 0이면 호출 프로세스의 pid가 사용 • - pid와 pgid가 동일하면 리더로 설정 • - pgid가 0이면 pid가 프로세스 그룹 식별번호로 설정

  5. 환경 • name=something • showmyenv.c • setmyenv.c • getenv(), putenv()

More Related