On Thu, 26 Jun 2014 15:55:59 +0000, C. Thomas Stover wrote:

The macro you reference made me curious. Gthreads (part of glib) written
> in C, is a wrapper around pthreads or win32 depending on how it was
> built. This allows for a mix of generic code that uses the wrappers and
> back-end specific code wrapped in #ifdef for portability.
>
> While I am aware that C++ 11 introduced a threading abstraction in-
> language, I am not aware of the details. Does it not internally wrap OS
> thread APIs? Are you trying to also mix generic C++11 threading with os
> specific threading sections, or just use the native os APIs?
>
> Pthreads on windows is yet another variation on a theme since it would
> have to wrap the win32 threading api. Even with that I believe there is
> still a way to mix in some straight up win32 api code if so needed. I
> would be interested in hearing the details form those who know.


Well, I'm not trying to mix in the same build. I have a c++11 code which
works well under linux, but as I've read that c++11 threads under windows
have several drawbacks (MinGW-w64 is reported slower than with win32
threads, and MSVC c++11 threads are buggy). So I'd like to keep a
preprocessor driven win32 threads fallback code until things get more
stable.

I have not tried anything so far and my knowledge of these threading issues
is quite limited, so I'm just reported what I've read by searching the topic

Etienne


2014-06-26 19:50 GMT+02:00 <[email protected]>:

> Send Mingw-w64-public mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Mingw-w64-public digest..."
>
>
> Today's Topics:
>
>    1. Re: [PATCH] Add softmath mainly for ARM (Kai Tietz)
>    2. How to detect which threading model is used with  the
>       preprocessor? (Etienne Sandr?-Chardonnal)
>    3. Re: How to detect which threading model is used with the
>       preprocessor? (Ruben Van Boxem)
>    4. [PATCH 0/2] Fix generating *.idl files for IPsec  include
>       headers (Martin Willi)
>    5. [PATCH 1/2] fwptypes.idl: Remove  FWPM_DISPLAY_DATA0 type
>       defintion (Martin Willi)
>    6. [PATCH 2/2] iketypes.idl: Remove superfluous      #endif (Martin
> Willi)
>    7. Re: How to detect which threading model is used   with    the
>       preprocessor? (C. Thomas Stover)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 26 Jun 2014 00:06:38 +0200
> From: Kai Tietz <[email protected]>
> Subject: Re: [Mingw-w64-public] [PATCH] Add softmath mainly for ARM
> To: "[email protected]"
>         <[email protected]>
> Message-ID:
>         <
> caewic4z+hedihigfxqj4gjbgc_ecxw8vvyghqgydc1oa+f5...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Look great.
>
> Thanks,
> Kai
>
> 2014-06-25 23:22 GMT+02:00 Andr? Hentschel <[email protected]>:
> > Am 24.06.2014 22:28, schrieb Kai Tietz:
> >> 2014-06-22 14:38 GMT+02:00 Andr? Hentschel <[email protected]>:
> >>> -----BEGIN PGP SIGNED MESSAGE-----
> >>> Hash: SHA1
> >>>
> >>> Am 21.06.2014 22:06, schrieb Kai Tietz:
> >>>> 2014-06-21 18:10 GMT+02:00 Andr? Hentschel <[email protected]>:
> >>>>> Am 21.06.2014 17:10, schrieb Andr? Hentschel:
> >>>>>> Hi,
> >>>>>> this time i just put some commits on github for review [1],
> >>>>>> so please review, then i'll commit it except of the temporary tests.
> >>>>>> (btw, this is the work of more than two weeks...)
> >>>>>>
> >>>>>> [1] https://github.com/AndreRH/mingw-w64/commits/master
> >>>>>>
> >>>>>
> >>>>> Here it is as patch (without Makefile.in)
> >>>>
> >>>> Patch is ok.  Only thing we might want to change here is softfloat.c.
> >>>> I don't think we should have one file implementing many math functions
> >>>> without need.  So functions, which can go into own files, should be
> >>>> isolated, and it might be of interest to make out of softfloat.c
> >>>> instead an include file.
> >>>
> >>> 1) Why is it so bad to have all in one file?
> >> Because that reasons to link all functions into binary at once.
> >> Without LTO you get a lot of stuff you might not need into your
> >> executable.
> >>> 2) How do you want it exactly? sin.def.h and so on? which functions
> could stay in softfloat.c?
> >> Well, something like implementation file.  I wouldn't name them .h.
> >> Call them sin.c ... which includes the shared stuff from (best static
> >> or inline) softfloat.h.  The none-inline version of those shared
> >> function could be placed into softfloat.c.
> >>
> >> Kai
> >
> > OK, how is that?
> >
> >
> >
> ------------------------------------------------------------------------------
> > Open source business process management suite built on Java and Eclipse
> > Turn processes into business applications with Bonita BPM Community
> Edition
> > Quickly connect people, data, and systems into organized workflows
> > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > http://p.sf.net/sfu/Bonitasoft
> > _______________________________________________
> > Mingw-w64-public mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 26 Jun 2014 09:12:30 +0200
> From: Etienne Sandr?-Chardonnal <[email protected]>
> Subject: [Mingw-w64-public] How to detect which threading model is
>         used with       the preprocessor?
> To: [email protected]
> Message-ID:
>         <CAM-xo90QYT0+8f4NSqNO3gCmAZ_1RPtMHSGo=tJ_R=
> [email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> Is it possible to detect the threading model (win32 / pthreads) with the
> preprocessor?
>
> At least I would like to make the code compile in these two cases
>  - mingw-w64 with native win32 thread support : use win32 api
>  - mingw-w64 with pthreads or linux gcc : use c++11
>
> Will _GLIBCXX_HAS_GTHREADS work in these cases or is this mingw-only?
>
> Thanks!
>
> Etienne
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 3
> Date: Thu, 26 Jun 2014 09:51:41 +0200
> From: Ruben Van Boxem <[email protected]>
> Subject: Re: [Mingw-w64-public] How to detect which threading model is
>         used with the preprocessor?
> To: "[email protected]"
>         <[email protected]>
> Message-ID:
>         <CALc40c8bUo8=
> [email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> 2014-06-26 9:12 GMT+02:00 Etienne Sandr?-Chardonnal <
> [email protected]>
> :
>
> > Hi,
> >
> > Is it possible to detect the threading model (win32 / pthreads) with the
> > preprocessor?
> >
> > At least I would like to make the code compile in these two cases
> >  - mingw-w64 with native win32 thread support : use win32 api
> >  - mingw-w64 with pthreads or linux gcc : use c++11
> >
> > Will _GLIBCXX_HAS_GTHREADS work in these cases or is this mingw-only?
> >
> > Thanks!
> >
>
> The posix threading model enabled toolchains do not interfere or prevent
> the use of Win32 threads. In fact, C++ std::thread is a wrapper of a
> wrapper (GCC's internal gthread) of a wrapper (winpthreads) of Win32 native
> threading primitives.
>
> The best way is actually a configure-time check for std::thread
> functionality (e.g. test a simple join() call). I know of no preprocessor
> macro.
>
> Ruben
>
>
> > Etienne
> >
> >
> >
> ------------------------------------------------------------------------------
> > Open source business process management suite built on Java and Eclipse
> > Turn processes into business applications with Bonita BPM Community
> Edition
> > Quickly connect people, data, and systems into organized workflows
> > Winner of BOSSIE, CODIE, OW2 and Gartner awards
> > http://p.sf.net/sfu/Bonitasoft
> > _______________________________________________
> > Mingw-w64-public mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 4
> Date: Thu, 26 Jun 2014 17:12:57 +0200
> From: Martin Willi <[email protected]>
> Subject: [Mingw-w64-public] [PATCH 0/2] Fix generating *.idl files for
>         IPsec   include headers
> To: [email protected]
> Message-ID: <[email protected]>
>
> Hi,
>
> > The header is generated from its *.idl though, and the idl needs
> > fixing accordingly.
>
> Sorry, missed that. The two follow-up commits should fix the associated
> *.idl
> files as well.
>
> Thanks,
> Martin
>
> PS: Please CC me in any reply, I'm not subscribed to the list.
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 26 Jun 2014 17:12:58 +0200
> From: Martin Willi <[email protected]>
> Subject: [Mingw-w64-public] [PATCH 1/2] fwptypes.idl: Remove
>         FWPM_DISPLAY_DATA0 type defintion
> To: [email protected]
> Message-ID: <[email protected]>
>
> After removing it from the header file, remove the definition from the
> generating .idl file as well.
> ---
>  mingw-w64-headers/include/fwptypes.idl | 7 -------
>  1 file changed, 7 deletions(-)
>
> diff --git a/mingw-w64-headers/include/fwptypes.idl
> b/mingw-w64-headers/include/fwptypes.idl
> index e3cbee5..d6a8db6 100755
> --- a/mingw-w64-headers/include/fwptypes.idl
> +++ b/mingw-w64-headers/include/fwptypes.idl
> @@ -375,11 +375,4 @@ typedef struct FWP_CONDITION_VALUE0_ {
>
>  cpp_quote("")
>
> -typedef struct FWPM_DISPLAY_DATA0_ {
> -  [string, unique] wchar_t *name;
> -  [string, unique] wchar_t *description;
> -} FWPM_DISPLAY_DATA0;
> -
> -cpp_quote("")
> -
>  cpp_quote("#endif /* WINAPI_PARTITION_DESKTOP. */")
> --
> 1.9.1
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Thu, 26 Jun 2014 17:12:59 +0200
> From: Martin Willi <[email protected]>
> Subject: [Mingw-w64-public] [PATCH 2/2] iketypes.idl: Remove
>         superfluous     #endif
> To: [email protected]
> Message-ID: <[email protected]>
>
> After removing it from the header file, remove the #endif quote from the
> generating .idl file as well.
> ---
>  mingw-w64-headers/include/iketypes.idl | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/mingw-w64-headers/include/iketypes.idl
> b/mingw-w64-headers/include/iketypes.idl
> index 4dba312..86adf0d 100755
> --- a/mingw-w64-headers/include/iketypes.idl
> +++ b/mingw-w64-headers/include/iketypes.idl
> @@ -234,7 +234,6 @@ typedef struct IKEEXT_PRESHARED_KEY_AUTHENTICATION1__ {
>    FWP_BYTE_BLOB presharedKey;
>    UINT32 flags;
>  } IKEEXT_PRESHARED_KEY_AUTHENTICATION1;
> -cpp_quote("#endif")
>  cpp_quote("")
>
>  typedef struct IKEEXT_CERTIFICATE_AUTHENTICATION0_ {
> --
> 1.9.1
>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Thu, 26 Jun 2014 15:55:59 +0000 (UTC)
> From: "C. Thomas Stover" <[email protected]>
> Subject: Re: [Mingw-w64-public] How to detect which threading model is
>         used    with    the preprocessor?
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=UTF-8
>
> On Thu, 26 Jun 2014 09:12:30 +0200, Etienne Sandr?-Chardonnal wrote:
>
> > Hi,
> >
> > Is it possible to detect the threading model (win32 / pthreads) with the
> > preprocessor?
> >
> > At least I would like to make the code compile in these two cases
> >  - mingw-w64 with native win32 thread support : use win32 api -
> >  mingw-w64 with pthreads or linux gcc : use c++11
> >
> > Will _GLIBCXX_HAS_GTHREADS work in these cases or is this mingw-only?
> >
> > Thanks!
> >
>
> The macro you reference made me curious. Gthreads (part of glib) written
> in C, is a wrapper around pthreads or win32 depending on how it was
> built. This allows for a mix of generic code that uses the wrappers and
> back-end specific code wrapped in #ifdef for portability.
>
> While I am aware that C++ 11 introduced a threading abstraction in-
> language, I am not aware of the details. Does it not internally wrap OS
> thread APIs? Are you trying to also mix generic C++11 threading with os
> specific threading sections, or just use the native os APIs?
>
> Pthreads on windows is yet another variation on a theme since it would
> have to wrap the win32 threading api. Even with that I believe there is
> still a way to mix in some straight up win32 api code if so needed. I
> would be interested in hearing the details form those who know.
>
>
>
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
>
> ------------------------------
>
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
> End of Mingw-w64-public Digest, Vol 81, Issue 17
> ************************************************
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to