` Copying data from string to cstring without triggering non-thread safe RTL calls (Andy Ireland) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Clarion in general: Copying data from string to cstring without triggering non-thread safe RTL calls
2002-12-17 -- Andy Ireland
 
Newsgroups: comp.lang.clarion Hi Gordon, > Clarion code can be thread safe (Andy will correct me on this, as there are > some special cases - like NEW...), but the runtime is not. This problem is > amplified as the runtime is used quite heavily in the automatic type > conversions.... Correct!. The keys to thread safe coding are.... a.) overide the clarion memory functions b.) make all groups ',auto' then clear using ZeroMemory() API c.) overide Cla$StoreCStr which allows cstring <<-- const assignments d.) avoid using unsigned types and multiplication / division. Multiply and divide where possible using bshift e.) use ref vars to Interfaces and classes and pass everything by address f.) execute unsafe code in the accept loop, not in a subclass or pre-emptive thread g.) replace clarions queue support with STL maps exported from a C++ DLL h.) export VC++'s C RTL functions that are needed as above for strlen etc This is why the OLE classes in FileExplorer are thread safe. 90% of clarion code is easy to make safe. The rest we created PlugIT for. The stack functions do not need to be overidden, but merely code that calls into them, avoided. Regards Andy Plugware Solutions.com Ltd, taking the puzzle out of I.T Tel : +44 1249 813335 Fax : +44 1249 813462


Today is April 19, 2024, 6:28 pm
This article has been viewed 35110 times.
Google search has resulted in 91 hits on this article since January 25, 2004.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: