prepare  for  running threads