public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/50175] data race with OMP barrier Date: Wed, 24 Aug 2011 15:02:00 -0000 [thread overview] Message-ID: <bug-50175-4-9gr9bHsbIF@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-50175-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50175 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |rth at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-24 14:55:18 UTC --- If this is about bar->arrived writes, then I don't see any races. During the lifetime of a barrier, in the first phase arrived is incremented by each thread, guarded by bar->mutex1 lock. The threads then unlock bar->mutex1 lock, except for the last thread which keeps it locked and decrements bar->arrived again, then, still with bar->mutex1 locked wakes up all the other threads which then either atomically, or guarded with bar->mutex2 lock, decrement bar->arrived again. The last of those threads then posts to bar->sem2 semaphore on which the thread holding bar->mutex1 is waiting before unlocking that lock. Thus, I don't see how the first phase (where bar->arrived adjustments are done guarded with bar->mutex1 lock) can overlap with the second phase (where it is decremented atomically or with mutex2). Not even the second phase with following first phase. Thus I think valgrind is wrong about this. CCing rth as author...
next prev parent reply other threads:[~2011-08-24 14:56 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-24 14:16 [Bug libgomp/50175] New: data race with barrier Joost.VandeVondele at pci dot uzh.ch 2011-08-24 15:02 ` jakub at gcc dot gnu.org [this message] 2013-03-29 9:11 ` [Bug libgomp/50175] data race with OMP barrier Joost.VandeVondele at mat dot ethz.ch
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-50175-4-9gr9bHsbIF@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).