úÎkFhY)      !"#$%&'(IThis module implements several kinds of futures using Concurrent Haskell portable provisional;sabel@ki.cs.uni-frankfurt.de; willig@ki.cs.uni-frankfurt.de) The type i implements explicit futures, i.e. if the value of the future is need it must be forced explicitly using  r creates an explicit future, i.e. the computation is performed concurrently. The future value can be forced using  ) forces the value of an explicit future (F), i.e. the calling thread blocks until the result becomes available. z creates an implicit future. A non-blocking concurrent computation is started. If the value of the future is needed, then r the future will be forced implicitly. The concurrent computation is killed if the calling thread stops, even if  is used  within .  behaves similar to N with the difference that the future is recursive, i.e. the future created by  0 is used as argument of the code of the future. *+,O is the global wrapper which should be used around the code involving futures.  I.e., instead of writing  main=code one should use main=withFuturesDo code. Note, that there  should be only one call to  in a program. 'creating a strict future is similar to ) with the difference that if used inside  n it is guaranteed that the concurrent computation is forced (and finished) before the main thread terminates.  Warning: / should only be used within the global wrapper ! a recursive variant of  (see  and 'future)  Warning: / should only be used within the global wrapper ! qa lazy future. Initially, no concurrent computation is started, but if the lazy future gets (implicitly) forced, / then the lazy future becomes a strict future.  Warning: / should only be used within the global wrapper ! a recursive variant of  (see  and 'future)  Warning:  / should only be used within the global wrapper ! a new handle component. creates a new handle. binds a handle to its value.    8This module implements a buffer with cells and futures. non-portable (requires Futures) experimental%willig@ki.informatik.uni-frankfurt.de -&A cell type. Cells provide an automic . operation. LThe buffer type contains of 3 cells and a handle. The first 2 cells are for Q communication of either a put or get is allowed. The thrist cell is the storage 3 cell, the last cell contains a the active handle. /Creates a new cell. .0MTestAndSet on cells provides test and set functions in one atomic operation. 1#Waits its argument to become true. Creates a new empty buffer. Puts a new value to a buffer.  blocks if  the buffer is full. GGets the contents of a non-empty buffer. If the buffer is empty, then 2 this function blocks until the buffer is filled.    FThis module implements a channel concurrency primitive using Buffers. non-portable (requires Futures) experimental%willig@ki.informatik.uni-frankfurt.de 234AA channel consists of a read-end buffer and a write-end buffer. > The Itemtype is required to link the buffers in the channel. 5,Creates a new empty channel. !Writes one value to a channel. A $ never blocks, since channels have  no bounding limiters. 5Reads out an item from the read-head of the channel.  It blocks on a empty channel. \Implements the same behaviour as writeChanContents from the module Control.Concurrent.Chan. ZImplements the same behaviour as getChanContents from the module Control.Concurrent.Chan. ( It reads permanently from the channel. ?Writes two equally typed lists to a given channel in parallel. :This module implements a quantity semaphores with buffers non-portable (requires Futures) experimental%willig@ki.informatik.uni-frankfurt.deMA quantity semaphores contains of a capacity and a waiting queue containing  buffers. 2Creates a new quantity semaphore of capacity cnt. Increments the semaphore'"s value, if there are no waiters.  ? reads out of the waiting queue and writes True into a waiting  . I Note: This operation equals to signalQSemN in Control.Concurrent.QSemN. Decrements the semaphore'6s value. If the value has already reached zero, then   creates a new empty  % that is being added to the semaphore's waiting queue. - It blocks until the buffer gets filled by a . G Note: This operation equals to waitQSemN in Control.Concurrent.QSemN. KUse the quantity semaphore to limit the computation of code. This function O performs a down on the given q. s., executues the code and returns after a up  on the q.s. . fThis module implements a bounded channel concurrency primitive using channels and quantity semaphores non-portable (requires Futures) experimental%willig@ki.informatik.uni-frankfurt.deCreates a new bounded channel KPerforms an up-operation on the QSem of the bounded channel and then reads 9 a value from the channel. The read operation may block. !KPerforms a down-operations on the QSem of the bounded channel and writes a 0 new value to it. The down-operation may block.  ! ! !:This module implements a quantity semaphores with handles non-portable (requires Futures) experimental%willig@ki.informatik.uni-frankfurt.de"UA handled quantity semaphores contains of a capacity and a waiting queue containing  handles. #2Creates a new quantity semaphore of capacity cnt. $Increments the semaphore'"s value, if there are no waiters.  upD reads out of the waiting queue and binds a waiting handle to True. I Note: This operation equals to signalQSemN in Control.Concurrent.QSemN. %Decrements the semaphore'3s value. If the value has already reached 0, then  down: creates a new handle that is being added to the semaphore's waiting queue. ? It blocks until the handle assigns a value to its future by a up. G Note: This operation equals to waitQSemN in Control.Concurrent.QSemN. 6#Waits its argument to become true. "#$%"#$%"#$%.This module implements barrier using futures. non-portable (requires Futures) experimental%willig@ki.informatik.uni-frankfurt.de&PA new barrier type contains of a buffer containing the count of active threads, F a buffer containing the a count of finished threads and a capacity. 'Creates a new barrier. (syncs on the barrier 7opens all synced threads 8#Waits its argument to become true. &'(&'(&'(QThis package implements various kinds of concurrency abstractions using futures. portable experimentalmwillig@gmx.de)  !"#$%&'(9      !"#$%&'()*+,-./0123456789:;;<:=:> caf-0.0.3"Control.Concurrent.Futures.Futures!Control.Concurrent.Futures.BufferControl.Concurrent.Futures.ChanControl.Concurrent.Futures.QSem Control.Concurrent.Futures.BChan Control.Concurrent.Futures.HQSem"Control.Concurrent.Futures.BarrierControl.Concurrent.FuturesEFutureefutureforcefuturerecursiveFuture withFuturesDo strictFuturestrictRecursiveFuture lazyFuturelazyRecursiveFuturebhandle newhandledhbindBuffernewBufputBufgetBufChanTypeChannewChan writeChanreadChanwriteChanContentsgetChanContents mergeChanQSemnewQSemupdownenterBChannewBChan readBChan writeBChanHQSemnewHQSemupHQSem downHQSemBarnewBarsyncBarManager newManagerregistersynchronizeManCellexchangecell testAndSetwaitItemItemTypeopenBar