Presentation is loading. Please wait.

Presentation is loading. Please wait.

BACKUP & Synchronization

Similar presentations


Presentation on theme: "BACKUP & Synchronization"— Presentation transcript:

1 BACKUP & Synchronization
CreateProcess/CreateThread/fork를 사용하여 네 개의 프로세스를 생성 (P0, P1, P2, P3) 각 프로세스는 서로 다른 폴더/디렉토리에서 다음과 같이 동기화를 수행 - 한 프로세스가 자신의 폴더에서 작업을 수행하면, 나머지 프로세스들이 자동적으로 자신들의 폴더에서 동일한 작업을 수행 (예) P0가 자신의 위치에서 usr 폴더/디렉토리를 생성하면, 나머지 프로세스 들도 자신들의 위치에서 동일한 폴더/디렉토리를 생성 P0가 파일 A,B,C를 생성하면, 나머지 프로세스들도 자동적으로 동일한 이름의 파일들을 생성 파일 A와 B는 자신들만 접근할 수 있는 local file이고, C는 모든 프로세스들이 공유할 수 있는 파일임

2 BACKUP & Synchronization
scenario) P0가 자신의 디렉토리에서 파일 A을 오픈하여 다음 내용을 참가 64K record no (0)%4=0 are updated in file P0디렉토리/A …… 나머지 프로세스 k의 디렉토리 A파일에도 다음과 같은 내용이 자동 첨가 P1: 64K record no (1)%4=1 are updated in file P1디렉토리/A ….. P2: 64K record no (2)%4=2 are updated in file P2디렉토리/A ….. P3: 64K record no (3)%4=3 are updated in file P3디렉토리/A ……

3 BACKUP & Synchronization
P0가 자신의 디렉토리에서 파일 A을 오픈하여 다음 내용을 참가 64K record no (4)%4=0 are updated in file P0디렉토리/A …… 나머지 프로세스 k의 디렉토리 A파일에도 다음과 같은 내용이 자동 첨가 P1: 64K record no (5)%4=1 are updated in file P1디렉토리/A ….. P2: 64K record no (6)%4=2 are updated in file P2디렉토리/A ….. P3: 64K record no (7)%4=3 are updated in file P3디렉토리/A ……

4 BACKUP & Synchronization
파일 C는 모든 프로세스가 공유하는 파일이므로 같은 파일에 내용이 첨가되어야 함 (파일 C는 P0 폴더/디렉토리에 있는 것으로 간주) P0가 파일 C을 오픈하여 다음 내용을 첨가 64K record no (0)%4=0 are updated in file P0디렉토리 /C 나머지 프로세스들도 동일한 C파일에 다음과 같은 내용을 자동 첨가 P1: 64K record no (1)%4=1 are updated in file P0디렉토리 /C P2: 64K record no (2)%4=2 are updated in file P0디렉토리 /C P3: 64K record no (3)%4=3 are updated in file P0디렉토리 /C …. …. …. ….. * 프로세스들의 내용이 섞이면 안됨. 쓰는 순서는 상관 없음

5 BACKUP & Synchronization
P0가 파일 C을 오픈하여 다음 내용을 첨가 64K record no (4)%4=0 are updated in file P0디렉토리 /C 나머지 프로세스들도 동일한 C파일에 다음과 같은 내용을 자동 첨가 P1: 64K record no (5)%4=1 are updated in file P0디렉토리 /C P2: 64K record no (6)%4=2 are updated in file P0디렉토리 /C P3: 64K record no (7)%4=3 are updated in file P0디렉토리 /C …. …. …. ….. * 프로세스들의 내용이 섞이면 안됨. 쓰는 순서는 상관 없음

6 BACKUP & Synchronization
파일C에 update시 동기화를 위해 한 프로세스가 update를 완료한 후 다른 프로세스가 내용을 자동 첨가해야 함 모든 이벤트들은 모니터링 파일에 축척되도록 함 2014년 5월 13일 오후 1시: 프로세스 P0: 64K record no (0)%4=0 are updated in file P0디렉토리 /C 2014년 5월 13일 오후 1시: 프로세스 P1: 64K record no (1)%4=0 are updated in file P0디렉토리 /C 2014년 5월 13일 오후 1시: 프로세스 P2: 64K record no (2)%4=0 are updated in file P0디렉토리 /C 2014년 5월 13일 오후 1시: 프로세스 P3: 64K record no (3)%4=0 are updated in file P0디렉토리 /C ………

7 P0 A B C P1 P2 P3 monitoring file
2014년 5월 12일 오후 4시: 프로세스 P0: 64K record no (0)%4=0 are updated in file P0디렉토리 /A 2014년 5월 12일 오후 4시: 프로세스 P1: 64K record no (1)%4=0 are updated in file P1디렉토리 /A 2014년 5월 12일 오후 4시: 프로세스 P2: 64K record no (2)%4=0 are updated in file P2디렉토리 /A 2014년 5월 12일 오후 4시: 프로세스 P3: 64K record no (3)%4=0 are updated in file P3디렉토리 /A 2014년 5월 13일 오후 1시: 프로세스 P0: 64K record no (0)%4=0 are updated in file P0디렉토리 /C 2014년 5월 13일 오후 1시: 프로세스 P1: 64K record no (1)%4=0 are updated in file P0디렉토리 /C 2014년 5월 13일 오후 1시: 프로세스 P2: 64K record no (2)%4=0 are updated in file P0디렉토리 /C 2014년 5월 13일 오후 1시: 프로세스 P3: 64K record no (3)%4=0 are updated in file P0디렉토리 /C


Download ppt "BACKUP & Synchronization"

Similar presentations


Ads by Google