Changes between Version 119 and Version 120 of LightweightConcurrency


Ignore:
Timestamp:
May 31, 2012 5:55:39 PM (3 years ago)
Author:
kc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LightweightConcurrency

    v119 v120  
    8282
    8383{{{
    84 data SContStatus = SContRunning |           -- SCont is currently running
    85                    SContKilled  |           -- SCont was killed by an (asynchronous) exception
     84data ResumeToken
     85
     86data SContStatus = SContRunning |
     87                     -- SCont is currently running
     88                   SContKilled  |           
     89                     -- SCont was killed by an (asynchronous) exception
    8690                   SContSwitched SContSwitchReason
    87 data SContSwitchReason = Yielded |          -- SCont has yielded, but runnable
    88                          BlockedInHaskell | -- SCont is blocked on a user-level concurrent
    89                                             -- data structure (MVars and such)
    90                          BlockedInRTS |     -- SCont is blocked on a foreign call, blackhole, etc,.
    91                          Completed          -- SCont has run to completion
     91data SContSwitchReason = Yielded |         
     92                           -- SCont has yielded, but runnable
     93                         BlockedInHaskell ResumeToken |
     94                           -- SCont is blocked on a user-level concurrent
     95                           -- data structure (MVars and such)
     96                         BlockedInRTS |     
     97                           -- SCont is blocked on a foreign call, blackhole, etc,.
     98                         Completed
     99                           -- SCont has run to completion
    92100
    93101setSContSwitchReason :: SCont -> SContSwitchReason -> PTM ()
     
    98106
    99107Before a switch operation, we expect the programmer to indicate the reason for switching through setScontSwitchReason. Exception is raised by the switch primitives if a switch reason has not been provided. When a switched SCont resumes execution, its status is automatically updated to `SContRunning`.
     108
     109Resume tokens are utilized for supporting asynchronous exceptions. Resume tokens are discussed along with the [#AsynchronousExceptions discussion on asynchronous exceptions].
    100110
    101111=== SCont-Local Storage ===