Hello Ruben and niXman!

(niXman...  Is that supposed to be some kind of superhero?)

On Wed, Sep 28, 2011 at 1:22 PM, Ruben Van Boxem
<vanboxem.ru...@gmail.com> wrote:
> 2011/9/28 niXman <i.nix...@gmail.com>
>>>
>>> It is a known problem and probably due to an operation libstdc++ does
>>> when
>>> std::thread is used that winpthreads doesn't like but should allow. I
>>> don't
>>> know how to fix this, sorry. Maybe Kai or JonY have more ideas on the
>>> matter.
>>>
>>> Ruben
>>
>> Hi Ruben!
>> Tell me, if I use pthread-win32 instead winpthreads would it solve this
>> problem?
>
> No, you can't use std::thread with pthreads-win32. It doesn't support all
> the required functionality.

I would disagree.  I have std::thread working correctly (as far as I can tell)
with pthreads-win32 and mingw-w64.  I had to make some minor -- essentially
trivial -- patches to the particular build of mingw-w64 that I was using, but
it wasn't much.

When I compiled my std::thread applications (with the pthreads-win32 solution),
I didn't have to use the "-static" option.

Ruben, correct me if I'm wrong, but I thought the main reasons for writing
winpthreads were to avoid the pthreads-win32 licensing issues, and to
implement the pthread handle as a scalar (pointer) (as is typical in most
unix implementations), rather than as a structure (as in pthreads-win32),
to gain greater compatibility with existing pthreads-based code.

That is to say, I don't believe winpthreads -- the new implementation of
pthreads -- was needed to get std::thread working, but was done for
other reasons.

As far as I can tell, with the exception of tweaking the handle issue, the
version of std::thread that ships with gcc works almost out of the box
with pthreads-win32.

niXman, if your use case is to use std::thread with mingw-w64 and
pthreads-win32, I should be able to refer you to some earlier posts that
show how to do it, and could probably give you some pointers if you
hit snags.

> ...
> Ruben

Best.


K. Frank

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to