4. Parallel Computing 14. Introduction


Figure 306: Shared Memory Multiprocessor



Download 85,22 Kb.
Pdf ko'rish
bet17/26
Sana16.01.2022
Hajmi85,22 Kb.
#375116
1   ...   13   14   15   16   17   18   19   20   ...   26
Bog'liq
14 Parallel Computing

Figure 306: Shared Memory Multiprocessor

As an example of how shared memory permits one process to control another, suppose

we want to make one process wait until an event occurs, as determined by another

process. We can achieve this in a shared memory machine by agreeing on a common

location to contain a flag bit. We agree in advance that a 0 in this bit means the event has

not occurred, while a 1 indicates it has. Then the process that potentially waits will test

the bit. If it is 0, it loops back and tests again, and so on. If it is 1, it continues. All the

signaling processor has to do is set the bit to 1.

The following code fragments show the use of a flag for signaling between two

processes.

Flag = 0 initially

Process A:

Process B:

A1:  ....

B1: ....

A2: Flag = 1;

B2: if( Flag == 0 )

goto B2;


A3: ....

B3: ....


The following state diagram shows that the signaling scheme works. The progress of

process A corresponds to the vertical dimension, and that of process B to the horizontal.

The components of each state are:

(ip of A, ip of B, Flag)

Note that states in which ip of B is B3 cannot be reached as long as Flag is 0. Only when

A has set the flag to 1 can such a state (at the lower-left corner) be reached.




Parallel Computing

599


A1, B1, 0

A2, B1, 0

A3, B1, 1

A1, B2, 0

A2, B2, 0

A3, B2, 1

A1, B3, 0

A2, B3, 0

A3, B3, 1


Download 85,22 Kb.

Do'stlaringiz bilan baham:
1   ...   13   14   15   16   17   18   19   20   ...   26




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish