PThreads on Windows

Everything related to the code /
Tout ce qui touche au code
Post Reply
milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

PThreads on Windows

Post by milipili » Thu Aug 07, 2008 12:48 pm

May be it would be good to use pthread on Windows.
1/ There is no significally performance loses
2/ We would have a real same behavior on all systems.

PThreads can be compiled with a static library even with Visual Studio.
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Thu Aug 07, 2008 2:02 pm

if it can avoid the shooting dead lock bug, why not ?

Concerning that bug, I am not so sure it's a thread locking bug ... if the UnitEngine thread dies it'll pause automatically all simulation threads ... I had this bug once on Linux (but it was fixed rewriting some code), so it may not be directly related to locking !
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Thu Aug 07, 2008 2:43 pm

This proposal is not related to this bug. But it can avoid platform specific bugs which are long to track down with a lot of supported platform.
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Thu Aug 07, 2008 2:58 pm

Yes and unfortunately we have a good example here :(
=>;-D Penguin Powered

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Post by shaddim » Tue Sep 30, 2008 5:57 pm

zuzuf wrote:Yes and unfortunately we have a good example here :(
sorry for using this topic for a general pthread-win32 question (was not able to find a solution on the pthread forums itself and elsewhere)... but because its also a potential problem for ta3d, it's OK to raise that question... ;)

so, here the question about the pthreads-win32 platform portability....
i used pthreads for that reason and was able to use it successfully with win32. The same code worked perfectly for linux32/64 ... but not with windows 64, which might be also a problem of the 64bit library build of pthreads i used (from the mozillla 64bit tools)... So, someone used pthreads-win32 sucessful with win64?
I would be really interessted in suggestions/help :)
greetings and thanks!

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Tue Sep 30, 2008 7:55 pm

Indeed you have to take pthreads from the buildtools (http://wiki.mozilla-x86-64.com/Download). If you use pthreads-win32 in a x86_64 app you might expect some strange issues ^^

You may try to recompile yourself the library with your code.
Damien Gerard
Ta3d & Yuni Developer

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Post by shaddim » Thu Oct 02, 2008 8:38 am

milipili wrote:Indeed you have to take pthreads from the buildtools (http://wiki.mozilla-x86-64.com/Download). If you use pthreads-win32 in a x86_64 app you might expect some strange issues ^^

You may try to recompile yourself the library with your code.
hello milipili, feared that (that i have to look at src level), but in general pthreads-32 is called 64 capable (if you search the last cvs entries and the mailinglist)... these 64bit mozilla builds are just crashing instantly... :P

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Re:

Post by shaddim » Wed Oct 13, 2010 5:13 pm

shaddim wrote:
milipili wrote:Indeed you have to take pthreads from the buildtools (http://wiki.mozilla-x86-64.com/Download). If you use pthreads-win32 in a x86_64 app you might expect some strange issues ^^

You may try to recompile yourself the library with your code.
hello milipili, feared that (that i have to look at src level), but in general pthreads-32 is called 64 capable (if you search the last cvs entries and the mailinglist)... these 64bit mozilla builds are just crashing instantly... :P
for a Visualstudio a 64bit pthreads DLL i found finally this patched version, which works for me
http://code.google.com/p/libusb-winusb- ... p&can=2&q=
patches somehow documented here, several patch parts were required looks like

for GCC pthread binary builds are available here (mingw64 project)
http://www.drangon.org/mingw/
or here (with diff-patch) http://sourceforge.net/projects/mingw-w ... p/download

mingw version not tested from me

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: PThreads on Windows

Post by milipili » Sun Oct 17, 2010 12:37 pm

The Yuni framework is about to drop pthread on Windows and will use the native API as soon as possible. From all tests we have done, pthread64 is not suitable for a production environment.
Damien Gerard
Ta3d & Yuni Developer

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Re: PThreads on Windows

Post by shaddim » Wed Nov 03, 2010 11:24 pm

milipili wrote:The Yuni framework is about to drop pthread on Windows and will use the native API as soon as possible. From all tests we have done, pthread64 is not suitable for a production environment.
intressting. in which sense it's not fitting? missing pool threading?

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: PThreads on Windows

Post by milipili » Wed Nov 10, 2010 9:51 pm

Mainly stability issues. Anyway I can't see good reasons to prefer pthread instead of the native system API.
Damien Gerard
Ta3d & Yuni Developer

Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests