Process Synchronization - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Process Synchronization

Description:

Title: Process Synchronization Author: June Last modified by: June Created Date: 11/3/2003 10:15:03 AM Document presentation format ... – PowerPoint PPT presentation

Number of Views:178
Avg rating:3.0/5.0
Slides: 21
Provided by: June183
Category:

less

Transcript and Presenter's Notes

Title: Process Synchronization


1
Process Synchronization
  • ?. ??????? ??????????

2
?????????????????????
  • ???????????????????????? 1 ???
  • ??????????????? (Mutual Exclusion)
  • ???????? (Critical Section)
  • Producer-Consumer problem
  • Semaphore
  • Dining Philosophers Problem

3
?????
  • ?????????????????????????? ????.?. ????????
    ?????????????? ?????????????????????
  • ??? ?.?. ????????????????
  • 1. PCB ???????
  • 2. ????????????????????????
  • 3. ?????????????????????????????
  • 4. Context Switch ???????
  • 5. Thread ??????????????

4
??????? ?????????????? CPU
Process
CPU
  • ????
  • DOS

5
?????????????????????
Process
Process
Process
CPU
  • ??? PCB ???? Context Switch
  • ?????????????? Deadlock, Loss of Data
    Integrity, etc.

6
???????? Loss of Data Integrity
  • ?????????????? ?????????????????????
  • ????????????????????????????????????? ????
    ??????, ????, ?????????, Address Space ???????
  • ?????????? OS ??? ?????? ???????????????????????
    ?????

?????. ???????????? 5 ?? ?????????????????????????
????????????????
7
????? Producer-Consumer
  • ??????????????????????????????????????????????
  • ???? ????????????? WinAmp, ???????????????? Web
    Browser
  • ???????????? ???? Buffer ?????????????????????
  • ??????? Process ???? 2 ??? ?????? Producer ???
    Consumer ?????????????????????????? Buffer
    ?????????????????????????? Buffer

Producer
Consumer

Buffer
Data
8
??????????????????????? ?
  • ??????? ?.?. ?????? 5 ???? ???????????????????????
    ?????????????????? Producer-Consumer
    ????????????????????
  • ..
  • ?????
  • ???????????????????????
  • ??? Producer ?????????/?????????
  • ??? Consumer ?????????/?????????
  • ??? Buffer ??????????
  • ??? Buffer ??????????

9
????????????
  • ??????? ?.?. ?????? 5 ???? ???????????????????????
    ????????????????? Producer-Consumer
    ????????????????????
  • .....
  • ?????????????????
  • ????????????????????????? (Synchronize)
  • ??????????????????????????????????????????????
  • Producer ???????????????
  • Consumer ??????????????

10
???????????
  • ???????? Buffer ???? ?????? ????????? n1
  • Producer ????????????????????????? in
  • Consumer ???????????????????????? out

0
1
n
2
out
in
11
????????????????????? ?
  • LAB
  • ??? ??. ?????????? ??????????????????????????????
    ????????????????? O.S.2 ??????????????? LAB.
  • ????????????? LAB os2-1
  • ??????? 20 ????
  • ????????????? ???????????

12
LAB os2-1
  • ????????????
  • 1. ???????? ??. ???????????????????????
  • 2. ?????????????????????????????????????? OS ???
  • ?????
  • ????????? ?????????????? ?????????????????????
  • ????????????????? ????? (index)

0
1
n
2
13
????????????????? C
(?????)
14
???
???????????????????????? ?
????????? Process ??? Producer ??? Consumer
15
???????????????????
  • ???????????????????? 2 ?????? ??????????
    ???????????????????????????????
    ??????????????????????????????????????????????????
    ?
  • ??????????? Database ???? ???? ????????????????
  • ???????????????????
  • Thread
  • ??? 2 Threads ???????????????????
  • Java ????????????????? Thread

16
??????????? Thread
  • Thread ??? ?????????????? (Light weight process)
  • Thread ????? Memory ?? Address Space
    ??????????????
  • Thread ????????????????????? (Multi-threading)

Process
Thread
CPU
17
???????????? Java ?????? Thread
18
???????? ??????????
??????? Producer
19
Consumer
20
??????????
Write a Comment
User Comments (0)
About PowerShow.com