implement the threadpool mechanism and test the thread and threadpool