Changes between Version 1 and Version 2 of ParametersCowan


Ignore:
Timestamp:
08/25/10 19:16:05 (7 years ago)
Author:
cowan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ParametersCowan

    v1 v2  
    4242Returns a new parameter object which is bound in the global dynamic environment to a cell containing the value returned by the call `(`''converter''` `''init''`)`. If ''converter'' is not specified the identity function is used instead.  The conversion procedure can be used to coerce ''init'' to a suitable type or to signal an error if its type is inappropriate. 
    4343 
    44 Invoking the returned parameter object with no arguments returns the value it currently refers to.  Invoking the returned parameter object with a single argument ''x'' causes it to refer to ''x''.,\ 
     44Invoking the returned parameter object with no arguments returns the value it currently refers to.  Invoking the returned parameter object with a single argument ''x'' causes it to refer to ''x''. 
    4545 
    4646{{{ 
     
    9696== Interaction with threads == 
    9797 
    98 SRFI 39 does not specify how parameter objects interact with threads.  ParametersSnellPym provides mutable parameters shared between threads, which threads may safely mutate to share information.  I take the view that using parameter objects in this way is an improper and unnecessary conflation of two distinct facilities, dynamic variables and shared data.  Instead, some mechanism for exchanging data between threads, such as mailboxes, should be provided as a part of standardizing threads, probably in WG2. 
     98SRFI 39 does not specify how parameter objects interact with threads.  ParametersSnellPym provides mutable parameters shared between threads, which threads may atomically mutate to share information.  I take the view that using parameter objects in this way is an improper and unnecessary conflation of two distinct facilities, dynamic variables and shared data.  Instead, some mechanism for exchanging data between threads, such as mailboxes, should be provided as a part of standardizing threads, probably in WG2. 
    9999 
    100 Therefore, this proposal specifies that when a parent thread creates a new child thread, the parameter objects in the child thread are new objects whose ''initial'' contents are the same  (in the sense of `eqv?`) as their ''current'' (not initial) values in the parent thread.  In this way, parameters in the child thread are initialized sensibly but operate independently of the parent thread. 
     100Therefore, this proposal specifies that when a parent thread creates a new child thread, the cells inside the parameter objects in the child thread are new objects whose ''initial'' contents are the same  (in the sense of `eqv?`) as their ''current'' (not initial) values in the parent thread.  In this way, parameters in the child thread are initialized sensibly but operate independently of the parent thread. 
    101101 
    102 Most implementations that provides SRFI 39 can trivially provide this facility.  The exceptions are implementations like Scheme48 which neither copy nor share parameter objects with child threads, but provide freshly initialized objects instead. 
    103102 
    104103== Thanks == 
     
    107106 
    108107 
    109