implement thread aware memory pool