[CE U17 C++] Generate and attach POD in parallel

Hi guys.

In my logic, I should generate and attach a lot of little POD files to the MicroStation DGN document. For example, it can be about 100 files (each file has 10000 points and 400 Kb of disk space). One file can be generated and attached in 52-57 milliseconds, it's very fast. But 100 files take about 5 seconds in total. And when I generate and attach these files in a simple loop - MicroStation UI just freeze for these 5 seconds and I see the total result of attaching all files in the end.

But I need some "streaming" analog. Each file should be generated and attached some parallel. It shouldn't freeze the UI. And the user should see how points appear in the graphic area dynamically, in portions.

How can I do it? Is the MicroStation and Point Cloud Writer support multi-thread and parallel work?

Here is my code of how I create and attach 1 single POD:

ISessionMgrR sessionMgr = ISessionMgr::GetManager();
DgnModelRefR model = *sessionMgr.GetActiveDgnModelRefP();

Bentley::PointCloud::PointCloudPodWriter pointCloudWriter;
StatusInt status = pointCloudWriter.Initialize();

Bentley::WString PodFilePath(filePath); // filePath - full path to POD file from method parameter
status = pointCloudWriter.StartStream(PodFilePath.c_str());
status = pointCloudWriter.AddGroup(Bentley::PointCloud::PointCloudPodWriter::Group_Combine, L"Group");
status = pointCloudWriter.AddCloud(Bentley::PointCloud::PointCloudPodWriter::Cloud_RGB, L"Cloud", NULL, 0, 0);

// some loop where we add points with next method:
for (...)
{
    UChar ch = 0;
    pointCloudWriter.AddPoint(point3d, &rbg, 1000, NULL, ch);
}

status = pointCloudWriter.EndStream();
status = pointCloudWriter.BuildPod();

if (status == 0) // SUCESS
{
    Bentley::DgnDocumentMonikerPtr moniker = Bentley::DgnPlatform::DgnDocumentMoniker::CreateFromFileName(PodFilePath.c_str());
    Bentley::DgnPlatform::PointCloudPropertiesPtr properties = Bentley::DgnPlatform::PointCloudProperties::Create(*moniker, model);

    DgnPlatform::EditElementHandle element;
    Bentley::DRange3d infiniteRange = Bentley::DRange3d::FromMinMax(-1.7976931348623157E+308, 1.7976931348623157E+308);
    status = Bentley::DgnPlatform::PointCloudHandler::CreatePointCloudElement(element, model, *properties, infiniteRange);
    if (status == 0)
    {
        status = element.AddToModel();
    }
}