Skip to content
Tcl Source Code History Of Ticket 849901ffffffffff
Login

History Of Ticket 849901ffffffffff

Artifacts Associated With Ticket 849901ffffffffff

  1. Ticket change [61e46b01a5] (rid 92321) by s_a_white on 2003-11-26 22:16:37:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I was wondering if anything could be supported towards
      cooperative event threading in standard tcl.
      
      What I mean is that each event + main gets it own
      stack.  Currently when we call update or use tkwait
      (and friends) the current execution blocks and a new
      event starts.  The old execution appears not to start
      until completion of all events.
      
      However what about making all stacks independent such
      that an execution can be marked as sleeping.  For an
      update an old execution will not be marked as runnable
      until all events are processed providng the same
      behaviour as before.
      
      Things performing tkwait will however become runnable
      earlier and perhaps at the end of the current event
      things that have become runnable should be processed
      before any further new events.
      
      The result is basically cooperative multi-tasking for
      events allowing us to provide mutex style event
      blocking through tkwait, etc.  This sort of support I
      feel is lacking where you are forced to do an update to
      complete  an operation and a new overlapped operation
      occurs that you wish to process after the current one
      has finished, but to do that you must terminate (or
      somehow regenerate later) the new one.
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "s_a_white"
    9. subsystem initialized to: "49. Threading"
    10. title initialized to: "Cooperative event threading"
    11. type initialized to: "RFE"
  2. Ticket change [a1bd28f49b] (rid 109778) by dkf on 2005-01-12 16:45:50:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      I am extremely inclined to say "No Way!" to this. Here's why.
      
      Threads are something that always causes trouble, what with
      either too many locks or bizarre race conditions. 
      Cooperative threading is a bit better in some ways, but
      still causes headaches. And you can get the effects through
      careful design of event handlers and callbacks (I've done
      this in the past). On a practical implementation level, the
      main problem with cooperative threading is that it requires
      a total redesign of the way Tcl uses the C stack.
      
      If you really need threads, use the Thread extension and get
      *real* threads (i.e. fewer problems with syscalls) together
      with a threading/ITC model that is much easier to use. It
      might not be everything that you're after, but it is *so*
      much less effort on our part! :^)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [b348147f42] (rid 98506) by s_a_white on 2005-01-12 18:00:01:

    1. icomment:
      Logged In: YES 
      user_id=59929
      
      I did try out the threading extensions first in the hope
      they would do what I required.  However unless this is
      nolonger true, you were forced to have things like seperate
      interpreters and such which didn't work.  I need objects,
      global variables, displays to be accessable by both.  It
      would be great if threading was like c where everything had
      access to everything and you just protect as required, this
      would work great.
      
      As for the event cooperative order switching: an example
      situation (and there are many different others and alot more
      complicated) is that the user presses a button to start a
      sequence.  This calls some code, which calls so more code,
      etc, etc so we are now down a number of levels on the stack
      with specific parameters.  Finally we get to a central point
      which which decides to act on it but says hang on I can't
      just yet because that section of code is already running as
      an update had to be executed.
      
      Then as explained we are forced to drop the event or get it
      somehow at the back of the event queue.  Ideally i would
      just tkwait on variable and then when the other code
      finishes it would just resume, however it never does because
      the older event is permenantly blocked by this one doing a
      tkwait.
      
      I'm afraid I am not aware in the changes required, but
      assumed the code supplied its own stack that wouldn't be
      tied to the C stack itself (since tcl operations have
      different lifetimes to the C parsing of the tcl).  The tcl
      pro debugger also shows the stack restarting so there
      appears to be some concept of seperate tcl stacks per event,
      so hoped it maybe just a matter of order switching (in some
      sort of controlled way).
      
      
      
    2. login: "s_a_white"
    3. mimetype: "text/plain"
    4. username: "s_a_white"
  4. Ticket change [ea06d825b5] (rid 104905) by dkf on 2009-06-18 15:31:26:

    1. closedate changed to: "2009-06-18T08:31:26"
    2. closer changed to: "dkf"
    3. icomment:
      
      
      allow_comments - 1
      
      Should be possible to use 8.6's coroutine support to do something like this.
      
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. resolution changed to: "Accepted"
    7. status changed to: "Closed"
    8. username: "dkf"