public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: 김규래 <msca8h@naver.com>
To: "Jakub Jelinek" <jakub@redhat.com>
Cc: <gcc@gcc.gnu.org>
Subject: Re: Re: [GSoC'19, libgomp work-stealing] Task parallelism runtime
Date: Mon, 22 Jul 2019 19:00:00 -0000	[thread overview]
Message-ID: <d455e79784586d2cf8a713bd5ad7d86@cweb002.nm.nfra.io> (raw)
In-Reply-To: <20190722185413.GA13123@laptop.zalov.cz>

> Yes, you can look up the definition.
> gomp_ barrier_last_thread is just a bit in the state bitmask passed to the
> routine, it is set on the last thread that encounters the barrier, which is
> figured out by doing atomic subtraction from the counter.

I saw the implementation, just wanted to be sure that's the general case.
Thanks.
 
Ray Kim
 
-----Original Message-----
From: "Jakub Jelinek"<jakub@redhat.com>
To: "김규래"<msca8h@naver.com>;
Cc: <gcc@gcc.gnu.org>;
Sent: 2019-07-23 (화) 03:54:13 (GMT+09:00)
Subject: Re: Re: [GSoC'19, libgomp work-stealing] Task parallelism runtime
 
On Sun, Jul 21, 2019 at 04:46:33PM +0900, 김규래 wrote:
> About the snippet below,
>  
>   if (gomp_barrier_last_thread (state))
>     {
>       if (team->task_count == 0)
> {
>   gomp_team_barrier_done (&team->barrier, state);
>   gomp_mutex_unlock (&team->task_lock);
>   gomp_team_barrier_wake (&team->barrier, 0);
>   return;
> }
>       gomp_team_barrier_set_waiting_for_tasks (&team->barrier);
>     }
>
> Am I safe to assume that gomp_barrier_last_thread is thread-safe?

Yes, you can look up the definition.
gomp_ barrier_last_thread is just a bit in the state bitmask passed to the
routine, it is set on the last thread that encounters the barrier, which is
figured out by doing atomic subtraction from the counter.

Jakub

  reply	other threads:[~2019-07-22 19:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <e2a9f7c55311795785d0f2c47f70acbd@cweb001.nm.nfra.io>
2019-06-24 19:55 ` 김규래
2019-06-24 20:13   ` Jakub Jelinek
2019-07-13  7:46   ` John Pinkerton
2019-07-09 12:56 ` 김규래
2019-07-13  6:28   ` Jakub Jelinek
2019-07-21  7:46     ` 김규래
2019-07-22 18:54       ` Jakub Jelinek
2019-07-22 19:00         ` 김규래 [this message]
2019-08-03  9:12           ` 김규래
2019-08-05 10:32             ` Jakub Jelinek
2019-08-05 11:01               ` 김규래
     [not found]                 ` <20190819061020.GA27842@laptop.zalov.cz>
2019-08-25  7:49                   ` 김규래

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=d455e79784586d2cf8a713bd5ad7d86@cweb002.nm.nfra.io \
    --to=msca8h@naver.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /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: link
Be 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).