updated thread_init to support initialisation of many instances of memory manager