From: LIU Hao <lh_mouse@126.com>
To: i.nixman@autistici.org
Cc: Jonathan Wakely <jwakely@redhat.com>,
libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org,
Eric Botcazou <ebotcazou@adacore.com>
Subject: Re: Adding a new thread model to GCC
Date: Fri, 21 Oct 2022 20:19:45 +0800 [thread overview]
Message-ID: <496a1d58-674a-cdb2-1e00-873bd5870ac3@126.com> (raw)
In-Reply-To: <a6cbfe9c5158e13bcfd115008caa2512@autistici.org>
[-- Attachment #1.1: Type: text/plain, Size: 1833 bytes --]
在 2022/10/21 19:54, i.nixman@autistici.org 写道:
>
> I have a questions:
> 1) wouldn't it be logical not to write yet another implementation of pthreads-wor-windows, but to
> make changes to the winpthreads library because it's already supported by GCC? (maybe I don’t know
> about some reasons why it wasn’t done ...)
>
While it is possible to rebuild winpthreads from scratch, I don't think it's worth:
* There are many POSIX facilities that we don't support: rwlock,
cancellation, signals, etc.
* GCC can choose to implement `std::thread` etc. on C11 <threads.h>,
which libcxx already has, but I haven't tested it.
(mcfgthread also has a C11 header, but not one for libcxx.)
> It seems to me the ideal and logical option is to make your implementation part of GCC, as suggested
> by Eric B.
> the advantages are as follows:
> 1) we will get a high-quality native implementation.
> 2) there is no need to add another thread model for GCC.
> 3) with dynamic linking there is no need to ship another dll with the program. (Windows users really
> don't like this =))
>
Jacek Caban, who is also a mingw-w64 developer, expressed the same idea a few days ago.
While integrating mcfgthread into gcc is practically possible, my concerns are:
* GCC never provides a threading library. It always depends on glibc,
musl, win32 APIs, winpthreads, etc.
* Tampering with the win32 thread model in a dramatic way is not
acceptiable due to backwards compatibility. There are distributions
that have win32 as the default thread model, such as Debian.
* I personally need more control for future development, for example,
re-implement pthread or adding libcxx support, which doesn't fit in
GCC.
--
Best regards,
LIU Hao
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2022-10-21 12:20 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-01 18:34 LIU Hao
2022-10-01 20:02 ` Bernhard Reutner-Fischer
2022-10-21 9:58 ` Jonathan Wakely
2022-10-21 10:09 ` i.nixman
2022-10-21 10:48 ` Jonathan Wakely
2022-10-21 10:55 ` i.nixman
2022-10-21 11:36 ` LIU Hao
2022-10-21 11:54 ` i.nixman
2022-10-21 12:19 ` LIU Hao [this message]
2022-10-21 12:34 ` i.nixman
2022-10-24 3:40 ` LIU Hao
2022-10-24 20:50 ` Jacek Caban
2022-10-21 11:44 ` Eric Botcazou
2022-10-21 11:55 ` i.nixman
2022-10-24 6:53 ` i.nixman
2022-10-24 8:15 ` Eric Botcazou
2022-10-24 8:20 ` i.nixman
2022-10-31 9:18 ` Eric Botcazou
2022-10-31 15:22 ` i.nixman
2022-11-01 5:22 ` i.nixman
2022-11-01 9:09 ` Eric Botcazou
2022-11-02 12:05 ` i.nixman
2022-11-02 21:27 ` Eric Botcazou
2022-11-02 21:40 ` i.nixman
2022-12-16 17:18 ` Jonathan Wakely
2022-12-16 19:20 ` Eric Botcazou
2022-12-22 12:21 ` Jonathan Yong
2022-12-22 12:28 ` i.nixman
2022-12-23 23:59 ` Jonathan Yong
2022-12-24 5:58 ` NightStrike
2022-12-24 6:27 ` i.nixman
2022-12-24 13:50 ` i.nixman
2022-12-24 15:42 ` i.nixman
2022-12-24 15:57 ` i.nixman
2022-12-24 21:22 ` i.nixman
2022-12-25 1:10 ` Jonathan Yong
2023-01-09 21:56 ` Eric Botcazou
2022-12-24 6:22 ` i.nixman
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=496a1d58-674a-cdb2-1e00-873bd5870ac3@126.com \
--to=lh_mouse@126.com \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=i.nixman@autistici.org \
--cc=jwakely@redhat.com \
--cc=libstdc++@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: 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).