For multi-thread