multithread initialization.