Hi everyone,
I am encountering a read access violation error in the STEPCAFControl_Reader class, specifically within the ReadStream() method.
My application reads a large number of STEP files (up to 50,000) using multiple concurrent threads. Each thread uses STEPCAFControl_Reader to read files via the ReadStream() method. However, when processing a high volume of files concurrently, I am experiencing intermittent memory corruption and read access violation crashes. I suspect this is related to thread safety issues.
After some research, I understand that in OpenCASCADE version 7.9.0, only the StepControl_Reader::ReadFile method was made thread-safe, but it seems that STEPCAFControl_Reader::ReadStream may not be fully thread-safe.
Details:
->OpenCASCADE version: 7.9.0
->Number of STEP files: up to 50,000(Min)
->Crashes occur randomly: sometimes after reading a few files, sometimes after many, and occasionally the process completes successfully.
->Crashes happen either at:
IFSelect_ReturnStatus readStatus = CafReader.ReadStream(id, inputStream);
or even at the creation of STEPCAFControl_Reader CafReader;
Has anyone else faced similar issues? Is STEPCAFControl_Reader::ReadStream() fully thread-safe in 7.9.0? Are there recommended approaches or workarounds for reading large numbers of STEP files concurrently without running into memory corruption?
Thanks in advance for your help!