Changes between Version 24 and Version 25 of Concurrency


Ignore:
Timestamp:
Mar 31, 2006 3:52:02 PM (8 years ago)
Author:
simonmar@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Concurrency

    v24 v25  
    1818 * [http://research.microsoft.com/~simonpj/papers/stm/ Software Transactional Memory] 
    1919 
    20 == Pros == 
    21  * Vital for some modern applications and large applications commonly require it. 
    22  * Stable {{{MVar}}} implementation is well understood and tested. 
    23  
    24 == Cons == 
    25  * Imposes non trivial implementation constraints. 
    26  * Providing a 'select' and non-blocking IO would be enough to allow people to implement something like it themselves in haskell and are provided by most systems as primitives. 
    27  * Things like the 'poor man's concurrency monad' can achieve some of the benefits 
    28  
    29  
    3020-------------- 
    3121 
     
    3727At least the following interface will be provided 
    3828 
    39  * Control.Concurrent.MVar - everything except addMVarFinalizer 
    40  * Control.Concurrent - ThreadId,myThreadId,forkIO,yield,threadWaitRead[1],threadWaitWrite[1],threadDelay 
     29 * [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurrent-MVar.html Control.Concurrent.MVar] - everything except {{{addMVarFinalizer}}} 
     30 * [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurrent.html Control.Concurrent] - {{{ThreadId}}}, {{{myThreadId}}}, {{{forkIO}}}, {{{yield}}}, {{{sleep}}} (replaces {{{threadDelay}}}). 
     31 * {{{Control.Concurrent.Chan}}}, {{{Control.Concurrent.QSem}}}, {{{Control.Concurrent.QSemN}}}, 
     32   {{{Control.Concurrent.SampleVar}}} 
    4133 
    4234the FFI must be able to handle 'concurrent nonrentrant' imports, but not 
     
    6759== Misc library stuff == 
    6860 
    69 yield is guarenteed to choose an alternate thread if another one exists and is 
     61{{{yield}}} is guarenteed to choose an alternate thread if another one exists and is 
    7062runnable. 
    7163 
    72 threadDelay guarentees the thread will wait as long as its argument at a 
     64{{{sleep}}} guarentees the thread will wait as long as its argument at a 
    7365minimum. it may be blocked for longer. 
    7466 
    75 == notes == 
     67== I/O == 
    7668 
    77 [1] may be moved to another module (Control.Concurrent.IO?) , routines working on Handles should be 
    78 added too. 
     69I/O operations from {{{System.IO}}}, {{{System.Directory}}}, {{{System.Process}}} (and others?) do not prevent other threads from making progress when they are waiting for I/O to complete. 
     70 
     71We could provide a lower-level non-blocking I/O interface along the lines of {{{threadWaitRead}}}, {{{threadWaitWrite}}}, perhaps in {{{Control.Concurent.IO}}}. 
    7972 
    8073= Optional extensions to basic standard =