Basic multithread version.