multi threads template