Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
News

Keep Threading in Mind

the future of starts demands massive productivity

In my interview with Martin he talked a lot about the importance of performance, which is one of the reasons he uses Delphi for his real-time lighting control systems. He said something along the lines that if you are not programming with threading in mind then you are never going to get good performance. That is good advice. Even cell phones have quad-core processors in them these days.

keep threading in mind 4276637

 

Delphi includes a great Parallel Programming Library which I really like. There is also the ever popular OmniThreadLibrary. They both make parallel programming much easier. I just learned about a new helper library to make parallel programming even easier.

CocinAsync: A Delphi library to simplify coding and improve performance of asynchronous and multithreaded applications.

It includes a number of different units and helpers. According to Jason Southwell, the developer, he has found a “100 to 150% improvement in performance over equivalent generic container wrapped in a critical section.” So how does it do this? If you look at the page the first thing you see is a brilliant couple helpers: QueueIfInThread & SynchronizeIfInThread.

We all know it is important to make sure certain code is synchronized into the main thread, unfortunately we end up with multiple code paths some and some code could be executed in the main thread via one call, and a background thread in another call. Using this helper only performs the synchronization if the code was called from a background thread.

That is just one of the helper classes included in CocinAsync. Take a look at it and keep threading in mind.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Director of Delphi Consulting for GDK Software USA. Many software related patents, including swipe and pattern unlock and search engines. First Silver and Gold Delphi badges on Stack Overflow Former Developer Advocate for Embarcadero Technologies. Long time fan of programming, especially with Delphi. Author, Podcaster/YouTuber, Improvisor, Public Speaker, Father, and Friend.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES