Changes between Version 3 and Version 4 of Chapel


Ignore:
Timestamp:
02/24/12 11:03:51 (14 years ago)
Author:
zirkel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Chapel

    v3 v4  
    6565 * procedure declaration
    6666 * variable declaration
     67 * yield
    6768 == Expressions ==
    6869 * Literal
     
    8283   * & & (Logical and)
    8384 * = (Assignment)
     85
     86= Iterators and for/forall =
     87
     88The use of iterators in for/forall loops can be implemented using a manager-worker strategy.  When an iterator is encountered, the caller ("manager") spawns a new process to run the iterator.  In addition to any declared parameters, the iterator has an extra parameter for the process ID of the manager.  Whenever the iterator encounters a yield statement, it sends the yielded value to the manager.  The manager then non-deterministically distributes the yielded value to one of n worker threads, which sets the loop variable to that value and runs the loop.  When the end of the iterator is reached, it sends a special termination message.  The manager then sends termination messages to all works and waits for them to complete.