Discussions of the Parallel Programming book
 help / color / mirror / Atom feed
* Memory barrier pairing question
@ 2018-07-23  1:42 Artem Polyakov
  2018-07-23  2:37 ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Artem Polyakov @ 2018-07-23  1:42 UTC (permalink / raw)
  To: perfbook

[-- Attachment #1: Type: text/plain, Size: 838 bytes --]

Hello,
I have a question about the following scenario (considering POWER arch):

initial { x = 0; y = 0; }

thread0 {
    x = 1;
    lwsync;
    y = 1;
}

thread1 {
    a = y;
    isync;
    b = x;
}

Because "isync" is not a memory barrier this example doesn't have
read/write barrier pairing. However, if I understand correctly, lwsync will
ensure that "x = 1" will become visible to thread1 before lwsync is done
and before "y = 1" will become visible. So "isync" here can be sort of
control dependency as it ensures that "a = y" will be performed before "b =
x" and even will flush the pipeline according to POWER9 spec.

Can someone comment on this scenario and tell if I am right or where I am
wrong.

-- 
С Уважением, Поляков Артем Юрьевич
Best regards, Artem Y. Polyakov

[-- Attachment #2: Type: text/html, Size: 1231 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-23 13:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-23  1:42 Memory barrier pairing question Artem Polyakov
2018-07-23  2:37 ` Paul E. McKenney
2018-07-23  4:52   ` Artem Polyakov
2018-07-23 12:03     ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox