Re: [Mingw-w64-public] New Rubenvb GCC 4.8 std::thread enabled build

2013-04-02 Thread Ruben Van Boxem
2013/4/2 Baruch Burstein bmburst...@gmail.com

 Can you explain the difference from your regular builds? Does
 std::thread not work with them? If I use std::thread, do I need to
 link/distribute any additional libraries? Or are there special licenses
 issues?
 In short: Why 2 separate builds?


std::thread (and other stuff like mutex) only works on the builds labeled
stdthread'. The difference is that gcc is built based on the posix
threading model using the winpthreads library. The result is a libstdc++
that has multithreading functionality. The affected headers are thread,
mutex, condition_variable, and future. atomic has always worked and
will continue to work without posix threading.

You will need to additionally distribute the winpthreads dll if you do not
link statically. There are no licensing issues, as the winpthreads code is
placed in the Public Domain in the same way the rest of the MinGW-w64
headers and crt are.

The two builds are incompatible due to the difference in libgcc. All code
has to be recompiled with the same toolchain.

I have two builds because currently enabling posix threading (like in the
std::thread builds) makes libgcc depend on winpthreads. This is not a
problem for most people, but it does make even C code not using pthreads
that depends on libgcc (pretty much all code compiled by gcc depends on
libgcc), depend on winpthreads as well.

Ruben



 On Tue, Mar 26, 2013 at 9:02 PM, Ruben Van Boxem vanboxem.ru...@gmail.com
  wrote:

 Hi,

 I have uploaded a new GCC 4.8 experimental std::thread build. Nothing
 fundamentally changed since the previous posix-threaded builds.

 Enjoy,

 Ruben

 Find the goodies here:

 http://sourceforge.net/projects/mingw-w64/files/Toolchain%20sources/Personal%20Builds/rubenvb/experimental/

 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/

 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/


 --
 Own the Future-Intelreg; Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest.
 Compete for recognition, cash, and the chance to get your game
 on Steam. $5K grand prize plus 10 genre and skill prizes.
 Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




 --
 ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı


 --
 Own the Future-Intel(R) Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand prize plus 10 genre and skill prizes. Submit your demo
 by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] New Rubenvb GCC 4.8 std::thread enabled build

2013-04-02 Thread Ruben Van Boxem
Op 2 apr. 2013 11:51 schreef Kai Tietz ktiet...@googlemail.com het
volgende:

 2013/4/2 Ruben Van Boxem vanboxem.ru...@gmail.com

 2013/4/2 Baruch Burstein bmburst...@gmail.com

 Can you explain the difference from your regular builds? Does
std::thread not work with them? If I use std::thread, do I need to
link/distribute any additional libraries? Or are there special licenses
issues?
 In short: Why 2 separate builds?


 std::thread (and other stuff like mutex) only works on the builds
labeled stdthread'. The difference is that gcc is built based on the posix
threading model using the winpthreads library. The result is a libstdc++
that has multithreading functionality. The affected headers are thread,
mutex, condition_variable, and future. atomic has always worked and
will continue to work without posix threading.

 You will need to additionally distribute the winpthreads dll if you do
not link statically. There are no licensing issues, as the winpthreads code
is placed in the Public Domain in the same way the rest of the MinGW-w64
headers and crt are.


 To clarify, the winpthread isn't public domain, and was never public
domain, and never will be public domain!  It is, was, and will stay
licensed under BSD.

Oops, sorry!




 The two builds are incompatible due to the difference in libgcc. All
code has to be recompiled with the same toolchain.

 I have two builds because currently enabling posix threading (like in
the std::thread builds) makes libgcc depend on winpthreads. This is not a
problem for most people, but it does make even C code not using pthreads
that depends on libgcc (pretty much all code compiled by gcc depends on
libgcc), depend on winpthreads as well.

 Ruben



 On Tue, Mar 26, 2013 at 9:02 PM, Ruben Van Boxem 
vanboxem.ru...@gmail.com wrote:

 Hi,

 I have uploaded a new GCC 4.8 experimental std::thread build. Nothing
fundamentally changed since the previous posix-threaded builds.

 Enjoy,

 Ruben

 Find the goodies here:

http://sourceforge.net/projects/mingw-w64/files/Toolchain%20sources/Personal%20Builds/rubenvb/experimental/

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/


--
 Own the Future-Intelreg; Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest.
 Compete for recognition, cash, and the chance to get your game
 on Steam. $5K grand prize plus 10 genre and skill prizes.
 Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




 --
 ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı


--
 Own the Future-Intel(R) Level Up Game Demo Contest 2013

 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand prize plus 10 genre and skill prizes. Submit your demo
 by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2

 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




--
 Own the Future-Intel(R) Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand prize plus 10 genre and skill prizes. Submit your demo
 by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




--
 Own the Future-Intel(R) Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand prize plus 10 genre and skill prizes. Submit your demo
 by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, 

Re: [Mingw-w64-public] New Rubenvb GCC 4.8 std::thread enabled build

2013-04-02 Thread Baruch Burstein
Just to clarify that I understand the process:
The GCC implementation of thread and friends (part of the libc or libgcc
or libstdc++ or whatever the GCC standard library is called) really uses
pthread calls under the hood. Changing that would mean changing the code of
the standard library implementation. So in order to use those headers, an
implementation of pthreads needs to exist and be available to the linker =
winpthreads. Is this correct?

I assume that these builds automatically have -lwinpthreads or whatever the
correct name is added to the linking command, since it would be needed for
every compilation? Does just using a static CRT give me a static
winpthreads, too, or are they separate?

Would having one build with winpthreads bundled into the libstdc++.dll (or
whatever it is) not work?


On Tue, Apr 2, 2013 at 12:38 PM, Ruben Van Boxem
vanboxem.ru...@gmail.comwrote:

 2013/4/2 Baruch Burstein bmburst...@gmail.com

 Can you explain the difference from your regular builds? Does
 std::thread not work with them? If I use std::thread, do I need to
 link/distribute any additional libraries? Or are there special licenses
 issues?
 In short: Why 2 separate builds?


 std::thread (and other stuff like mutex) only works on the builds
 labeled stdthread'. The difference is that gcc is built based on the posix
 threading model using the winpthreads library. The result is a libstdc++
 that has multithreading functionality. The affected headers are thread,
 mutex, condition_variable, and future. atomic has always worked and
 will continue to work without posix threading.

 You will need to additionally distribute the winpthreads dll if you do not
 link statically. There are no licensing issues, as the winpthreads code is
 placed in the Public Domain in the same way the rest of the MinGW-w64
 headers and crt are.

 The two builds are incompatible due to the difference in libgcc. All code
 has to be recompiled with the same toolchain.

 I have two builds because currently enabling posix threading (like in the
 std::thread builds) makes libgcc depend on winpthreads. This is not a
 problem for most people, but it does make even C code not using pthreads
 that depends on libgcc (pretty much all code compiled by gcc depends on
 libgcc), depend on winpthreads as well.

 Ruben



 On Tue, Mar 26, 2013 at 9:02 PM, Ruben Van Boxem 
 vanboxem.ru...@gmail.com wrote:

 Hi,

 I have uploaded a new GCC 4.8 experimental std::thread build. Nothing
 fundamentally changed since the previous posix-threaded builds.

 Enjoy,

 Ruben

 Find the goodies here:

 http://sourceforge.net/projects/mingw-w64/files/Toolchain%20sources/Personal%20Builds/rubenvb/experimental/

 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/

 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/


 --
 Own the Future-Intelreg; Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest.
 Compete for recognition, cash, and the chance to get your game
 on Steam. $5K grand prize plus 10 genre and skill prizes.
 Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




 --
 ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı


 --
 Own the Future-Intel(R) Level Up Game Demo Contest 2013

 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand prize plus 10 genre and skill prizes. Submit your demo
 by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2

 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




 --
 Own the Future-Intel(R) Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand prize plus 10 genre and skill prizes. Submit your demo
 by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




-- 
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness 

Re: [Mingw-w64-public] New Rubenvb GCC 4.8 std::thread enabled build

2013-04-02 Thread Ruben Van Boxem
2013/4/2 Baruch Burstein bmburst...@gmail.com

 Just to clarify that I understand the process:
 The GCC implementation of thread and friends (part of the libc or libgcc
 or libstdc++ or whatever the GCC standard library is called) really uses
 pthread calls under the hood. Changing that would mean changing the code of
 the standard library implementation. So in order to use those headers, an
 implementation of pthreads needs to exist and be available to the linker =
 winpthreads. Is this correct?


Yes. It is actualy libgcc that provides an abstraction in the form of
gthreads internally used by libstdc++ (and other languages' standard
libraries) to implement the top-level functionality.


 I assume that these builds automatically have -lwinpthreads or whatever
 the correct name is added to the linking command, since it would be needed
 for every compilation? Does just using a static CRT give me a static
 winpthreads, too, or are they separate?


libgcc != crt. The C library you will link too is msvcrt.dll, which is a
Windows system library present on every system. libgcc is a compiler suppor
library providing tons of miscellaneous functionality required to make the
generated code work. You can link to libgcc statically by adding
-static-libgcc to the linker commandline, to libstdc++ by adding
-static-libstdc++ and everything static (including a static winpthreads, if
the libraries are available) by using plain -static.

If you want a static winpthreads but shared libgcc/libstdc++, you'll need
to remove libwinpthread.dll.a from your toolchain directory. Your mileage
may vary. Note my current builds only work with -static, I omitted the
known fix for this issue from my recent builds.



 Would having one build with winpthreads bundled into the libstdc++.dll (or
 whatever it is) not work?


Sure, it might work, but I'm no going to hack that into GCC's brittle build
system.

Ruben




 On Tue, Apr 2, 2013 at 12:38 PM, Ruben Van Boxem vanboxem.ru...@gmail.com
  wrote:

 2013/4/2 Baruch Burstein bmburst...@gmail.com

 Can you explain the difference from your regular builds? Does
 std::thread not work with them? If I use std::thread, do I need to
 link/distribute any additional libraries? Or are there special licenses
 issues?
 In short: Why 2 separate builds?


 std::thread (and other stuff like mutex) only works on the builds
 labeled stdthread'. The difference is that gcc is built based on the posix
 threading model using the winpthreads library. The result is a libstdc++
 that has multithreading functionality. The affected headers are thread,
 mutex, condition_variable, and future. atomic has always worked and
 will continue to work without posix threading.

 You will need to additionally distribute the winpthreads dll if you do
 not link statically. There are no licensing issues, as the winpthreads code
 is placed in the Public Domain in the same way the rest of the MinGW-w64
 headers and crt are.

 The two builds are incompatible due to the difference in libgcc. All code
 has to be recompiled with the same toolchain.

 I have two builds because currently enabling posix threading (like in the
 std::thread builds) makes libgcc depend on winpthreads. This is not a
 problem for most people, but it does make even C code not using pthreads
 that depends on libgcc (pretty much all code compiled by gcc depends on
 libgcc), depend on winpthreads as well.

 Ruben



 On Tue, Mar 26, 2013 at 9:02 PM, Ruben Van Boxem 
 vanboxem.ru...@gmail.com wrote:

 Hi,

 I have uploaded a new GCC 4.8 experimental std::thread build. Nothing
 fundamentally changed since the previous posix-threaded builds.

 Enjoy,

 Ruben

 Find the goodies here:

 http://sourceforge.net/projects/mingw-w64/files/Toolchain%20sources/Personal%20Builds/rubenvb/experimental/

 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/

 http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-experimental-stdthread/


 --
 Own the Future-Intelreg; Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest.
 Compete for recognition, cash, and the chance to get your game
 on Steam. $5K grand prize plus 10 genre and skill prizes.
 Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




 --
 ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı


 --
 Own the Future-Intel(R) Level Up Game Demo Contest 2013

 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand 

Re: [Mingw-w64-public] New Rubenvb GCC 4.8 std::thread enabled build

2013-04-02 Thread JonY
On 4/2/2013 20:05, Ruben Van Boxem wrote:
 If you want a static winpthreads but shared libgcc/libstdc++, you'll need
 to remove libwinpthread.dll.a from your toolchain directory. Your mileage
 may vary. Note my current builds only work with -static, I omitted the
 known fix for this issue from my recent builds.
 
 

You might end up with weird behavior if you mix thread handles about,
seeing that you now have 2 or more winpthreads instances, one in the
libstdc++ DLL, and others in your statically linked code.

Imagine if each DLL you used had their own statically linked instances.
It might work if the interfaces are rock solid without any
implementation detail leaks and/or depend on any static init variables
that may subject to race conditions.

If you want static, it is best to use static for everything.


 Would having one build with winpthreads bundled into the libstdc++.dll (or
 whatever it is) not work?

 
 Sure, it might work, but I'm no going to hack that into GCC's brittle build
 system.
 

Likewise, never a good idea to mix static/shared, it may cause ODR
violation.





signature.asc
Description: OpenPGP digital signature
--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] New Rubenvb GCC 4.8 std::thread enabled build

2013-04-02 Thread Baruch Burstein
Thank you all for your clear explanations!


On Tue, Apr 2, 2013 at 3:23 PM, JonY jo...@users.sourceforge.net wrote:

 On 4/2/2013 20:05, Ruben Van Boxem wrote:
  If you want a static winpthreads but shared libgcc/libstdc++, you'll need
  to remove libwinpthread.dll.a from your toolchain directory. Your mileage
  may vary. Note my current builds only work with -static, I omitted the
  known fix for this issue from my recent builds.
 
 

 You might end up with weird behavior if you mix thread handles about,
 seeing that you now have 2 or more winpthreads instances, one in the
 libstdc++ DLL, and others in your statically linked code.

 Imagine if each DLL you used had their own statically linked instances.
 It might work if the interfaces are rock solid without any
 implementation detail leaks and/or depend on any static init variables
 that may subject to race conditions.

 If you want static, it is best to use static for everything.

 
  Would having one build with winpthreads bundled into the libstdc++.dll
 (or
  whatever it is) not work?
 
 
  Sure, it might work, but I'm no going to hack that into GCC's brittle
 build
  system.
 

 Likewise, never a good idea to mix static/shared, it may cause ODR
 violation.





 --
 Own the Future-Intel(R) Level Up Game Demo Contest 2013
 Rise to greatness in Intel's independent game demo contest. Compete
 for recognition, cash, and the chance to get your game on Steam.
 $5K grand prize plus 10 genre and skill prizes. Submit your demo
 by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
 ___
 Mingw-w64-public mailing list
 Mingw-w64-public@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/mingw-w64-public




-- 
˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı
--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] New Rubenvb GCC 4.8 std::thread enabled build

2013-03-26 Thread K. Frank
Hello Ruben!

On Tue, Mar 26, 2013 at 3:02 PM, Ruben Van Boxem
vanboxem.ru...@gmail.com wrote:
 Hi,

 I have uploaded a new GCC 4.8 experimental std::thread build. Nothing
 fundamentally changed since the previous posix-threaded builds.

Yay!  Go Ruben!

 Enjoy,

Well, I'm not sure that enjoy is really the right word ...

 Ruben

Thanks.


K. Frank

--
Own the Future-Intelreg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public