initialize threads' ports