Page 1 of 1

PThreads on Windows

Posted: Thu Aug 07, 2008 12:48 pm
by milipili
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.

Posted: Thu Aug 07, 2008 2:02 pm
by zuzuf
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 !

Posted: Thu Aug 07, 2008 2:43 pm
by milipili
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.

Posted: Thu Aug 07, 2008 2:58 pm
by zuzuf
Yes and unfortunately we have a good example here :(

Posted: Tue Sep 30, 2008 5:57 pm
by shaddim
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!

Posted: Tue Sep 30, 2008 7:55 pm
by milipili
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.

Posted: Thu Oct 02, 2008 8:38 am
by shaddim
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

Re:

Posted: Wed Oct 13, 2010 5:13 pm
by shaddim
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

Re: PThreads on Windows

Posted: Sun Oct 17, 2010 12:37 pm
by milipili
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.

Re: PThreads on Windows

Posted: Wed Nov 03, 2010 11:24 pm
by shaddim
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?

Re: PThreads on Windows

Posted: Wed Nov 10, 2010 9:51 pm
by milipili
Mainly stability issues. Anyway I can't see good reasons to prefer pthread instead of the native system API.