Does tensorRT5 or tensorRT6 support multithreading?

I use tensorRT5 to test multithread support.I use the thread1 function ,it can be worked.But when I put function thread1 to thread and run thread_test function, the program break.

void ThreadTest::thread_test() {
    _thread1 = new std::thread(&ThreadTest::thread1, this);
}

void ThreadTest::thread1() {
    ASSD* detector = new ASSD("../model");
    cv::VideoCapture cap("../data/test.mp4");
    cv::Mat image;
    int count = 0;
    while (count<10000) {
        cap >> image;
        std::vector<BBoxInfo > outputBBoxes;
        std::chrono::time_point<std::chrono::system_clock> t1 = std::chrono::system_clock::now();
        //inference the image
        detector->detect(image, outputBBoxes);
        
        std::chrono::time_point<std::chrono::system_clock> t2 = std::chrono::system_clock::now();
        float dur = (float)std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count() / 1000;
        std::cout << "2222222222ASSD time:" << dur << "ms" << std::endl;
        for (int i = 0; i < outputBBoxes.size(); i++) {
            BBoxInfo facebox = outputBBoxes[i];
            cv::Rect box = cv::Rect(facebox.x1, facebox.y1, facebox.x2 - facebox.x1, facebox.y2 - facebox.y1);
            cv::rectangle(image, box, cv::Scalar(255, 0, 0), 2);
        }
        cv::namedWindow("test111", CV_WINDOW_NORMAL);
        cv::imshow("test111", image);
        cv::waitKey(1);
        count++;
    }
    
}

I think your should use multi stream

Hi,

You can find some suggestions for TensorRT with multithread here:
https://docs.nvidia.com/deeplearning/sdk/tensorrt-best-practices/index.html#thread-safety

Please refer to below dev talk:
https://devtalk.nvidia.com/default/topic/1032481/how-to-run-trt-in-multithreading-/

Thanks.