Discussions of the Parallel Programming book
 help / color / mirror / Atom feed
* counting examples
@ 2018-07-05 20:09 Imre Palik
  2018-07-05 23:05 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Imre Palik @ 2018-07-05 20:09 UTC (permalink / raw)
  To: paulmck, perfbook

Hi All,

first of all, thanks for the great book.

I have some doubts about some of the counting examples.  Namely, those
that implement inc_count() as a simple increment operation.  If there
is nothing to restrain the compiler/linker, they can possibly merge
several increments together, or optionally keep the counter value in a
register.

Of course, this won't happen with counttorture, because of the
barrier() in the loop.  But I wonder if that barrier() should be part
of inc_count() instead.  What do you think?

Thanks,

Imre


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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-05 20:09 counting examples Imre Palik
2018-07-05 23:05 ` 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