create and manipulate thread