public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: LIU Hao <lh_mouse@126.com>
Cc: gcc@gcc.gnu.org
Subject: Re: why does gccgit require pthread?
Date: Sun, 6 Nov 2022 20:37:03 -0800	[thread overview]
Message-ID: <CA+=Sn1ncp6hN8MnziZ+2f-6_UUqMwXeVGQLmft2NUeuXGOaBoA@mail.gmail.com> (raw)
In-Reply-To: <8f15b063-9ec8-59e0-590b-20e416f68cb4@126.com>

On Sun, Nov 6, 2022 at 7:59 PM LIU Hao via Gcc <gcc@gcc.gnu.org> wrote:
>
> Greetings,
>
> At the moment, there are references to pthread mutexes in 'gcc/jit/libgccjit.cc' and
> 'gcc/git/jit-playback.cc'. The former was introduced by 63b2923dc6f57e74d964a9cf14f4ba595ab14ed9 in
> 2020, while the latter was introduced by 38771e4e1fdacfbdac5a14e50fcc0538577b1bdb in 2014.
>
> Does this mean, GCC can't be built with JIT enabled, for some thread model other than `posix` (e.g.
> `win32`), where pthread isn't available?
>
> Can those references to mutexes be replaced with `__gthread_mutex_*` instead? However I see no other
> references to <gthr.h> inside the 'gcc' subdirectory, so I suspect it isn't an option there?

The original code which used pthread was added in GCC 5 way before GCC
moved to being written in C++11 which was only in the last 3 years.
pthread_* functions were the best choice at the time (2014) but now
GCC is written in C++11, I don't see any reason not to move them over
to using C++11 threading code.

Thanks,
Andrew


Thanks,
Andrew Pinski

>
>
> --
> Best regards,
> LIU Hao

  reply	other threads:[~2022-11-07  4:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07  3:58 LIU Hao
2022-11-07  4:37 ` Andrew Pinski [this message]
2022-11-07  6:50   ` LIU Hao
2022-11-07  7:03     ` Andrew Pinski
2022-11-07  7:10       ` LIU Hao
2022-11-07 12:57     ` Jonathan Wakely
2022-11-07 13:33       ` LIU Hao
2022-11-07 13:51         ` Jonathan Wakely
2022-11-11 17:16           ` Jonathan Wakely
2022-11-11 18:27             ` Jonathan Wakely
2022-11-15 18:50             ` why does gcc jit " David Malcolm
2022-11-15 19:01               ` Jonathan Wakely
2022-11-19 11:27                 ` Jonathan Wakely
2022-11-19 12:51                   ` LIU Hao

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='CA+=Sn1ncp6hN8MnziZ+2f-6_UUqMwXeVGQLmft2NUeuXGOaBoA@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=lh_mouse@126.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).