From 2ec9145613dc990346a8ec19dafa15fcf2ba7a30 Mon Sep 17 00:00:00 2001 From: Amit Murthy Date: Wed, 13 Dec 2017 15:10:56 +0530 Subject: [PATCH] optimize porthint in known range --- stdlib/Distributed/src/cluster.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/Distributed/src/cluster.jl b/stdlib/Distributed/src/cluster.jl index e658d639664c1..f8ddf81f29e9c 100644 --- a/stdlib/Distributed/src/cluster.jl +++ b/stdlib/Distributed/src/cluster.jl @@ -207,7 +207,8 @@ function start_worker(out::IO, cookie_in::Nullable{AbstractString}) init_worker(cookie) interface = IPv4(LPROC.bind_addr) if LPROC.bind_port == 0 - (port, sock) = listenany(interface, UInt16(0)) + port_hint = 9000 + (getpid() % 1000) + (port, sock) = listenany(interface, UInt16(port_hint)) LPROC.bind_port = port else sock = listen(interface, LPROC.bind_port)