thread manager and minheap