revise multi-threaded demo