implement the multithread framework