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

History Of Ticket 417839ffffffffff

Artifacts Associated With Ticket 417839ffffffffff

  1. Ticket change [4ba7356b8d] (rid 126750) by agentorange on 2001-04-21 14:54:58:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      In the attached code, I try to do what the vwait
      man page says should be possible.
      I have a top-level vwait and its event loop
      calls vwait on another variable.  I know the
      value of this new variable changes, but vwait
      never detects this change.  I think all
      Tcl8.x have this problem.
      
    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: "agentorange"
    9. subsystem initialized to: "02. Event Loops"
    10. title initialized to: "vwait bug"
    11. type initialized to: "Bug"
  2. Add attachment "lock.tcl" [f8c9d6c38f] (rid 91604) by agentorange on 2001-04-21 21:54:59.

  3. Ticket change [a263c6c4e9] (rid 109881) by agentorange on 2001-04-21 21:54:59:

    1. icomment:
      
      
      File Added - 5586: lock.tcl
      
      
      
    2. login: "agentorange"
    3. mimetype: "text/plain"
    4. username: "agentorange"
  4. Ticket change [d3166e28ff] (rid 113636) by dkf on 2001-04-23 16:38:24:

    1. assignee changed to: "dkf"
    2. closedate changed to: "2001-04-23T09:38:24"
    3. closer changed to: "dkf"
    4. icomment:
      Logged In: YES 
      user_id=79902
      
      This is not a bug, but a consequence of the fact that
      [vwait]s *nest*, and outer [vwait]s cannot terminate before
      all event handlers (containing calls to [vwait] as it turns
      out) finish.  In this case, you've got:
      
      main
        proc f2
          vwait temp
            after handler
              proc f1
                getLock
                  vwait lock
      
      As you can see, the wait for temp won't finish while all
      that clutter inside it is still going, but until that
      happens, the assignment to lock won't happen and the inner
      wait for lock won't terminate.  Hence DEADLOCK.
      
      No change of this behaviour is possible without a complete
      change of some pretty fundamental stuff (e.g. interpreters
      have to have multiple threads executing within them, meaning
      you need to introduce lots of semaphores and monitors, lots
      of code needs to be updated to no longer assume that event
      handlers run uninterruptably, etc.)
      
      The easiest way of fixing your code is probably to get rid
      of nested [vwait]s (and [update] and [tkwait] too) by never
      calling the command in an event handler (there are a few
      situations where it is useful, but this isn't one of them
      IMO) and to take advantage of the fact that event handlers
      will not be pre-empted by the interpreter.
      
      
    5. login: "dkf"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Closed"
    9. username: "dkf"
  5. Ticket change [cfcfaead78] (rid 113047) by agentorange on 2001-04-30 22:23:00:

    1. closedate changed to: "2001-04-30T15:23:00"
    2. closer changed to: "agentorange"
    3. icomment:
      Logged In: YES 
      user_id=162215
      
      I understand the problem now.  What is the correct way
      to implement locks in TCL?
      
      
    4. login: "agentorange"
    5. mimetype: "text/plain"
    6. username: "agentorange"