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
Copy file name to clipboardExpand all lines: doc/stdlib/parallel.rst
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,10 +117,14 @@ Tasks
117
117
118
118
Constructs a ``Channel`` that can hold a maximum of ``sz`` objects of type ``T``\ . ``put!`` calls on a full channel block till an object is removed with ``take!``\ .
119
119
120
+
``Channel(0)`` constructs a Channel without a backing store. Consequently a ``put!`` on a 0-sized channel will block till another task calls a ``take!`` on it. And vice-versa.
121
+
122
+
``isready`` on a 0-sized channel returns true if there are any tasks blocked on a ``put!`` ``fetch`` is unsupported on a 0-sized channel.
123
+
120
124
Other constructors:
121
125
122
-
* ``Channel()`` - equivalent to ``Channel{Any}(32)``
123
-
* ``Channel(sz::Int)`` equivalent to ``Channel{Any}(sz)``
126
+
* ``Channel(Inf)`` - equivalent to ``Channel{Any}(typemax(UInt))``
127
+
* ``Channel(sz)`` equivalent to ``Channel{Any}(sz)``
124
128
125
129
General Parallel Computing Support
126
130
----------------------------------
@@ -384,7 +388,11 @@ General Parallel Computing Support
384
388
385
389
.. Docstring generated from Julia source
386
390
387
-
Determine whether a ``Channel`` has a value stored to it. ``isready`` on ``Channel``\ s is non-blocking.
391
+
Determine whether a ``Channel`` has a value stored to it.
392
+
393
+
For 0-sized channels returns true if there are tasks waiting on a ``put!``
0 commit comments