WebMay 19, 2011 · For the method to be multi-thread safe (i.e. re-entrant) you should provide the temporary strings as parameters... I use this trick to have valid a dynamic array of TVarData containing some AnsiString content in a class. In fact, TVarData and TVarRec both uses such non referenced pointer to strings, which can be confusing. http://www.delphigroups.info/2/04/521955.html
multithreading - Implement thread-safe logging - Stack Overflow
WebAug 27, 2024 · Newer Delphi versions come with CodeSite. SmartInspect is another alternative. Use synchronization primitives to make your class thread-safe: TCriticalSection, TMREWSync Make sure you understand the issues involved in multithreading and synchronization before attempting to write a thread-safe logging framework. WebFeb 19, 2015 · Add that string pointer into a global or parent-global TList or TThreadList depending on whether you have thread-safe ways of accessing the TList or not. Depending on when you want to sort I would sort the list either as soon as the thread changes its string in its string pointer or do the sort after many threads' string pointers have changed ... thom christopher one life to live 1996
A new mutlti-threading library for Delphi. (darkThreading)
WebFeb 20, 2024 · Yes, then FPass will be guaranteed to point to a long string heap object of refcount 1. – Andreas Rejbrand Feb 20, 2024 at 13:27 2 If there is no writing after multiple threads start accessing the data, then reading is thread safe. But your question would be more clear if you have added some code. WebMay 2, 2013 · No conflicts about thread safety and a clear description on causality. For a thread-safe queue, look at TThreadedQueue if you have Delphi-XE2 or newer. Here is an example outlining the above described queue approach. WebOct 31, 2015 · How i can pass pchar from the DLL? dll must be compatible with other apps, not just delphi. In help is written that it is dangerous to pass pointers to local variables, if we make this variable global, the code will not be thread-safe. We can safely pass a wide string,but in this case, the dll will not be compatible with other (non-Delphi) apps. thom claessen