_OSSpinLockLockSlow on removal

I am facing this problem in my application which is multithreaded.

The main thread spawns another thread that performs internal memory allocation.

//Main thread if(p) { Thread th1(TestFunc, 0); } //TestFunc in thread. unsigned long TestFunc (void * param) { //Do some memory allocation. } 

Both threads seem to be waiting for each other.

Callstack for the main thread:

 _OSSpinLockLockSlow GMFree operator delete (void *) Thread:: ~Thread () Thread:: ~Thread () 

For spawned thread

  _OSSpinLockLockSlow GMmalloc_zone_malloc_internal 

This is an example of a problem code.

Both the main stream and the generated stream appear to be waiting for each other.

What is the reason for this _OSSpinLockLockSlow?

+4
source share

Source: https://habr.com/ru/post/1490691/


All Articles