poor-man multythreading