RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
C++

How to enqueue TQueue from TTask with bcc32

Author: h.mohri

When considering migration from old C++Builder 10.2 Tokyo bcc32 project.
You can use functions such as TThread::CreateAnonymousThread() and TTask to improve performance.
In addition to TCriticalSection, you can also use System.TMonitor which supports multiple devices.
I will show you how to program bcc32 project using the above method.

TQueue<String> is created in Delphi.

TQueue<T> is in System::Generics::Collections.
To use TQueue<String>, describe it in Delphi as follows.

You can now use TQueue__1<System::UnicodeString>.

Create a class to run in the interior of the TTask.

Actually executed is void __fastcall Invoke(){}.
The internal in the task memory each other will use the System::TMonitor::Enter(f_mutex_); so as not to conflict.

It is a class that creates many TTasks.

We have created and stored many TTasks in std::vector<_di_ITask>.

Using TThread::CreateAnonymousThread() etc., the design method as shown below is also possible.

 


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

Related posts
C++Delphi

Get Free Responsive Cross-Platform Login Screen Templates For Android And iOS

C++CodeDelphi

Learn To Build A Python GUI For Working With The Numpy Library In A Delphi Windows App

C++Code

Learn About Using Right Angle Brackets In This C++11 Feature For Windows Development

C++DelphiRAD Studio

Learn How To Use WinRT In Your Native Windows Delphi And C++ Builder Apps

Leave a Reply

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

IN THE ARTICLES