Trouble making path tracer multithreaded, read access violation
I found out what was wrong. It wasn't related to multithreading at all.
I was taking in a vector in a constructor hitable_list(std::vector&lt;hitable*&gt; listVector) and using a pointer to the first element of the vector elsewhere. So as soon as the vector went out of scope the pointer became invalid.

To solve this issue I just removed this constructor and whenever I need to pass in a vector I make sure that the vector stays in scope always and directly pass in the pointer to the first element of the vector, and it's size.