Relative Content

Tag Archive for c++multithreadingc++17

Failing to join a thread

I’m making a program that creates some random arrays and then uses two different sorting functions to sort them. First, I create a vector of Fleet objects with different sizes. Then, for each fleet I create an array of threads and in each thread I put a lambda function that copies a fleet and sorts it. It works fine but when it comes to joining threads I get “Process finished with exit code -1073741819 (0xC0000005)”. It successfully joins the first thread but not the second. What might be the problem?