added some thread framework