Answer the question
In order to leave comments, you need to log in
How to deallocate dynamic memory shared by two threads?
The main thread creates a dynamic array. Then a detached thread is created that uses this dynamic array.
int *arr[N];
...
thread thr(Daughter);
thr.detach();
...
delete[] arr;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question