Der Martin: Win32-API: CreateThread(), Threads koordinieren

Beitrag lesen

Hallo,

A thread in an executable that calls the C run-time library (CRT) should use the _beginthreadex and _endthreadex functions for thread management rather than CreateThread and ExitThread; this requires the use of the multithreaded version of the CRT. If a thread created using CreateThread calls the CRT, the CRT may terminate the process in low-memory conditions.

das habe ich auch gelesen. Und wenn das "terminate the process in low-memory conditions" die einzige blöde Nebenwirkung ist, könnte ich das sogar verschmerzen. Aber ...

Verwendest Du die CRT im Thread?

Nein. 😀

Das ist ja fast kaum vermeidbar...

Würde ich nicht sagen. Für viele CRT-Standardfunktionen hält das Windows-API eine Alternative bereit, etwa wsprintf() anstatt sprintf(), lstrlen() anstatt strlen(), ReadFile() und WriteFile() anstatt fread() und fwrite(), und noch einige Kandidaten in der Art.

Ich bin gerade nochmal die knapp 600 Quellcode-Zeilen für meine DLL durchgegangen und habe keinen CRT-Funktionsaufruf gefunden.

Live long and pros healthy,
 Martin

--
Home is where my beer is.