The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Bug in thread implementation under windows?
Ryan C. Gordon
Guest

Quote:
Quote:
I think I've spotted a bug in the implementation of thread
under windows. Currently it uses the CreateThread call,
but it should use _beginthreadex, in order to do some C lib
startup, according to the msdn docs

Indeed, since the SDL.dll links to (and uses) MSVCRT.DLL, it should call
_beginthread (not necessarily _beginthreadex) from the MS crt to create
threads. The penalty for not doing so, however, is a small memory leak per
ended thread.

(catching up on my email queue and TODO list here, sorry for late
replies...)

What should Cygwin use in this case?

--ryan.
Bug in thread implementation under windows?
Sam Lantinga
Guest

Quote:
Quote:
Indeed, since the SDL.dll links to (and uses) MSVCRT.DLL, it should call
_beginthread (not necessarily _beginthreadex) from the MS crt to create
threads. The penalty for not doing so, however, is a small memory leak per
ended thread.

Quote:
What should Cygwin use in this case?

The same thing. SDL built under cygwin by default uses mingw, which is pure
MSVC runtime, and should use the same semantics.

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment
Bug in thread implementation under windows?
Ryan C. Gordon
Guest

Quote:
The same thing. SDL built under cygwin by default uses mingw, which is pure
MSVC runtime, and should use the same semantics.

Ok, good...I'll put this on the TODO list to fix.

Thanks,
--ryan.