Simple question i belive, is
outputdebugstring(pansichar(''));
Thread safe?
I/We have been using it in threads for debugging, and i never occurred to me if i should be doing it a different way.
(delphi7)
Simple question i belive, is
outputdebugstring(pansichar(''));
Thread safe?
I/We have been using it in threads for debugging, and i never occurred to me if i should be doing it a different way.
(delphi7)
Well, not that it isn't true, it is, but just so that you don't have to just take Lieven word for it:
Passing of data between the application and the debugger is done via a 4kbyte chunk of shared memory, with a Mutex and two Event objects protecting access to it. These are the four kernel objects involved.
Understanding Win32 OutputDebugString is an excellent article on the matter.
I've had trouble once, though, with strings in an ISAPI DLL. For some odd reason the IsMultiThread boolean defined in System.pas was not set! Causing weird AccessViolations, once the thread was running more than one thread... A simple "IsMultiThread:=true;" in a unit initialization fixed it.