[Gc] Memory leak in multithreaded application

Lothar Scholz scholz at scriptolutions.com
Sat May 12 05:59:49 PDT 2007

Hello Christophe,

Saturday, May 12, 2007, 3:03:55 P

CM> Browsing through the win32_thread.c file I saw that GC_CreateThread
CM> calls CreateThread. According to windows documentation it should use
CM> _beginthreadex and _endthreadex instead. "For an executable file linked
CM> with LIBCMT.LIB, do not call the Win32 ExitThread API; this prevents the
CM> run-time system from reclaiming allocated resources. _endthread and
CM> _endthreadex reclaim allocated thread resources and then call ExitThread."

This is old and outdated documentation, i heared in other groups a few
time that it is exactly the opposite now and that _beginthread or
_beginthreadex leaks memory.

But maybe you can write some test. It would be nice if someone can
prove this with a demonstrateable example.

Best regards,
 Lothar Scholz                mailto:scholz at scriptolutions.com

More information about the Gc mailing list