On Fri, 27 Jun 2014 14:00:06, K. Frank wrote:

> Well, it's not as easy... The code currently use a portable lib (Qt) for
> the
> > threads but the question is about splitting a part of the app code for
> > making a lib, intended to be used in a plugin sdk. And asking the
> customer
> > to depend on external libraries is a sensitive topic...
>
> It's not entirely clear to me what your problem is.  (In your original
> question
> you asked whether you could detect pthreads vs. win32 threads with the
> preprocessor at compile time.)
>
> Why not use g++ / pthreads on linux, and mingw-w64's g++ / winpthreads
> on windows and just use pthreads for your threading code?  I would expect
> (expect, but don't know for certain) that the Qt's QThreads end up getting
> mapped to native pthreads on linux and to win32 threads on windows.  But
> unless you try to synchronize your own "user" pthreads with QThreads, I
> think you should be able to use both pthreads and QThreads in the same
> application both on linux and windows.
>
> Could you sketch out the precise use case that you're concerned about?
>

I will probably do that (or even use std::thread).
The concern I had were about these posts & articles stating that mingw-w64
posix threads have a significant lower performance than win32 threads. As
I'm writing a monte-carlo integration, which is running on clusters, and
for which 5% perf drop is a money loss, I was thinking of writing a
win32-thread specific code and use the win32 only mingw-w64 build for that.
Hence the preprocessor question.

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
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to