Changes between Version 6 and Version 7 of Concurrency


Ignore:
Timestamp:
Mar 28, 2006 9:31:10 AM (8 years ago)
Author:
simonmar@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Concurrency

    v6 v7  
    2727 * Things like the 'poor man's concurrency monad' can achieve some of the benefits 
    2828 
    29 == Proposal ==           
     29 
     30---------------------- 
     31= Proposal =           
    3032 
    3133 * Standardise on Concurrent Haskell without STM.  It is our view that even in the presence of STM, {{{MVar}}}s offer 
     
    3436 * Use the semantics from [http://www.haskell.org/~simonmar/papers/conc-ffi.pdf Extending the Haskell FFI with Concurrency]  
    3537 
    36 Questions: 
     38 * Standardise a way to write thread-safe libraries that work with implementations that don't provide full concurrency support. 
     39 
     40== Questions == 
     41 
     42 * Decide whether the Haskell' report includes Concurrency (with a separate !NoConcurrency addendum to specify how implementations without concurrency behave), or whether Concurrency is specified in a separate addendum. 
    3743 
    3844 * Decide how much pre-emption is acceptable, and figure out how to specify this. 
    39  
    40  * Should we specify what an implementation that doesn't provide concurrency should do? (e.g. provide an implementation 
    41    of MVars in terms of IORefs, so that concurrency-safe libraries can be written portably). 
    4245 
    4346 * Require bound thread support, or make it optional?  (YHC has concurrency with non-blocking foreign calls, but doesn't 
    4447   have bound threads as yet.) 
    4548 
     49== Thread-safety == 
     50 
     51In order to write library code that is thread-safe when run in a multi-threaded environment, two things are needed: 
     52 
     53 1. a way to protect mutable state against race conditions 
     54 2. a way to declare that foreign calls are blocking 
     55 
     56For (1), we have two choices: 
     57 
     58 * Provide {{{MVar}}}s.  A non-concurrent implementation might implement them in terms of {{{IORef}}}, 
     59   for example. 
     60 
     61 * Provide STM.  Not entirely trivial to implement, even in a single-threaded implementation, because 
     62   exceptions have to abort a transaction. 
     63 
     64For (2), one option is ForeignBlocking. 
    4665 
    4766----------