This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Parallelize the compilation using Threads
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Giuliano Belinassi <giuliano dot belinassi at usp dot br>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, kernel-usp at googlegroups dot com, gold at ime dot usp dot br, Alfredo Goldman <alfredo dot goldman at gmail dot com>
- Date: Tue, 12 Feb 2019 15:12:35 +0100
- Subject: Re: Parallelize the compilation using Threads
- References: <CAEFO=4A0DJVDYze7P5mCOzDjGpJC1Y180nP_UmXxwqduy87=bA@mail.gmail.com> <CAFiYyc1kogmJ_5suHg+7fDaNjrYZnGjNGq4dew5uvc+w6-_BKQ@mail.gmail.com> <CAEFO=4D2GU_KNG8Z-JH_4R7tFeU1Mm+u627HpWQJYmr5O+Ym7Q@mail.gmail.com> <CAFiYyc0HMDtPLJKkkYhFULBbGt8n-41fWaMtqLNmUOu9gird7w@mail.gmail.com> <20190211214624.3liqkdhb64engnja@smtp.gmail.com>
On Mon, Feb 11, 2019 at 10:46 PM Giuliano Belinassi
<giuliano.belinassi@usp.br> wrote:
>
> Hi,
>
> I was just wondering what API should I use to spawn threads and control
> its flow. Should I use OpenMP, pthreads, or something else?
>
> My point what if we break compatibility with something. If we use
> OpenMP, I'm afraid that we will break compatibility with compilers not
> supporting it. On the other hand, If we use pthread, we will break
> compatibility with non-POSIX systems (Windows).
I'm not sure we have a thread abstraction for the host - we do have
one for the target via libgcc gthr.h though. For prototyping I'd resort
to this same interface and fixup the host != target case as needed.
Richard.
>
> Giuliano.