Put!(remotechannel, x) causes no error but an infinite run time

Hi Everyone,
i m trying to use RemoteChannel in Julia:
julia -p 2
x = RemoteChannel(()->Channel{Array{Float64,2}}(1))
a = [1 2 3 4; 5 6 7 8]
put!(x,a) ran perfect. But the maximal length of channel x is 1. So i expect that if i run put!(x,a) again, it would return an error. But it causes only an infinite run time and julia does not respone anymore, until i press the ctl+c to break the process. My Julia version is 1.7.2.
Best regards

I would expect put! to wait until the other process gets some data and there is free space in the channel again.

1 Like
help?> put!
search: put! permute! invpermute! pushfirst! permutedims! ispunct

[...]

  put!(rr::RemoteChannel, args...)

  Store a set of values to the RemoteChannel. If the channel is full,
  blocks until space is available. Return the first argument.

This is expected behavior - the channel you’ve given the RemoteChannel can only hold one item, so it blocks until the channel has space again.

1 Like

Oh i understand now, Thank you Guys!