I look over several similar question, but I couldn't find the proper solution for my situation. I am trying to do a omp parallel loop. Inside one of my functions in the parallel region, I am trying to create m_buffer which I guess is shared (it is a very huge and complicated piece of code, I am a user).
std::vector<char*> m_buffer;
...
bufIdx = i_element_size / sizeof(void*) - 1;
...
if (m_buffer[bufIdx] == nullptr)
{
...
}
else
{
//comes here!
}
Apparently one thread tries to allocate an element inside the buffer at index of 0. Attached to this question you will see the buffer in debug using vs 2013. I am wondering if there is a way to detect the situation beside if condition.
Aucun commentaire:
Enregistrer un commentaire