From bbbd932b6d5dfa999765ae74ef1dc2fcfb74595a Mon Sep 17 00:00:00 2001 From: Amit Murthy Date: Sun, 26 Jul 2015 12:02:43 +0530 Subject: [PATCH] doc updates --- doc/manual/parallel-computing.rst | 10 ++++++---- doc/stdlib/parallel.rst | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/manual/parallel-computing.rst b/doc/manual/parallel-computing.rst index 78a555c44a4675..4d34466c0c5857 100644 --- a/doc/manual/parallel-computing.rst +++ b/doc/manual/parallel-computing.rst @@ -452,12 +452,14 @@ holding objects of type ``T``. Multiple readers can read off the channel via ``fetch`` and ``take!``. Multiple writers can add to the channel via ``put!``. ``isready`` tests for the prescence of any object in the channel, while ``wait`` waits for an object to become available. +``close`` closes a Channel. On a closed channel, ``put!`` will fail, +while ``take!`` and ``fetch`` successfully return any existing values +till it is emptied. A Channel can be used as an iterable object in a ``for`` loop, in which -case the loop runs till the channel is open. The loop variable takes on -all values added to the channel. ``close`` closes a Channel causing -the loop to terminate. - +case the loop runs as long as the channel has data or is open. The loop +variable takes on all values added to the channel. An empty, closed channel +causes the ``for`` loop to terminate. Shared Arrays (Experimental) diff --git a/doc/stdlib/parallel.rst b/doc/stdlib/parallel.rst index a7232fad01bc88..1aa895d843013f 100644 --- a/doc/stdlib/parallel.rst +++ b/doc/stdlib/parallel.rst @@ -303,6 +303,14 @@ General Parallel Computing Support @async put!(rr, remotecall_fetch(p, long_computation)) isready(rr) # will not block +.. function:: close(Channel) + + Closes a channel. An exception is thrown by: + + * ``put!`` on a on a closed channel. + + * ``take!`` and ``fetch`` on an empty, closed channel. + .. function:: RemoteRef() Make an uninitialized remote reference on the local machine.