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. http://www.delphigroups.info/2/04/521955.html
Passing PChar from the Delphi DLL - Stack Overflow
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. fos bos in
multithreading - Implement thread-safe logging - Stack Overflow
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. WebOct 20, 2011 · The standard doesn't guarantee anything about threads. So to do anything with threads in C++, you have to rely on implementation-defined guarantees. And Then you can safely use std::string because each implementation tells you whether or not it is safe to use in a threaded environment. WebMay 25, 2015 · Yes, it is unsafe to let one thread modify a string field whilst another thread can read it at the same time, – TLama May 23, 2015 at 11:35 How can I make it safe ? – Marus Gradinaru May 23, 2015 at 14:16 Add a comment 1 Answer Sorted by: 0 You have a variable shared between multiple threads, with one thread modifying the variable. fosbos landshut dingolfing