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 is created in Delphi.
TQueue is in System::Generics::Collections.
To use TQueue, describe it in Delphi as follows.
[crayon-6a1a8577bf48f157429562/]
You can now use TQueue__1.
Create a class to run in the interior of the TTask.
[crayon-6a1a8577bf497920552996/]
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>.
[crayon-6a1a8577bf499979700166/]
Using TThread::CreateAnonymousThread() etc., the design method as shown below is also possible.

