Making a thread manager