You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the very least, there's a documentation issue. The example of a network server that can service multiple connections has a critical flaw because, we believe, the changes in closures from 0.4 to 0.5:
server =listen(2000)
whiletrue
sock =accept(server)
@asyncbegin
x =readline(sock)
write(sock, x)
endend
In [1]: import socket
In [2]: s = socket.socket()
In [3]: t = socket.socket()
In [4]: s.connect(('', 2000))
In [5]: t.connect(('', 2000))
In [6]: s.send('check 1\n')
Out[6]: 8
In [7]: t.recv(1024)
Out[7]: 'check 1'
Because a second connection was opened before there was a write to the first connection, sock got overwritten, causing the write on the first connection to be echoed on the second. This makes asynchronous and parallel tasks more difficult to reason about, and it's not obvious that this is expected/desired behavior.
The text was updated successfully, but these errors were encountered:
Discourse thread for reference: https://discourse.julialang.org/t/inconsistent-results-based-on-number-of-processes/5191
At the very least, there's a documentation issue. The example of a network server that can service multiple connections has a critical flaw because, we believe, the changes in closures from 0.4 to 0.5:
Because a second connection was opened before there was a write to the first connection,
sock
got overwritten, causing the write on the first connection to be echoed on the second. This makes asynchronous and parallel tasks more difficult to reason about, and it's not obvious that this is expected/desired behavior.The text was updated successfully, but these errors were encountered: