implement multithreading samples