Skip to content
Tcl Source Code History Of Ticket 1499394
Login

History Of Ticket 1499394

Artifacts Associated With Ticket 1499394

  1. Ticket change [0fe572e987] (rid 94872) by mistachkin on 2006-06-02 09:28:10:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      Patch that implements a forthcoming TIP, entitled
      "Script cancellation with Tcl_CancelEval" or something
      similar.
      
      Please test.  I would like to get some feedback on this
      patch so that any necessary changes can be made prior
      to writing the formal TIP.
      
      
    4. foundin initialized to: "TIP Implementation"
    5. priority initialized to: "7 High"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "mistachkin"
    9. subsystem initialized to: "45. Parsing and Eval"
    10. title initialized to: "Tcl_CancelEval"
    11. type initialized to: "Patch"
  2. Ticket change [8e89ab95c5] (rid 120123) by mistachkin on 2006-06-02 16:28:10:

    1. icomment:
      
      
      File Added - 180282: script_cancellation.zip
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  3. Ticket change [9ee56a41e1] (rid 96555) by mistachkin on 2006-06-06 16:34:22:

    1. icomment:
      
      
      File Deleted - 180282: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  4. Add attachment "script_cancellation_2.zip" [fb32c78ffc] (rid 92011) by mistachkin on 2006-06-06 16:41:24.

  5. Ticket change [0414ec3875] (rid 119933) by mistachkin on 2006-06-06 16:41:24:

    1. icomment:
      
      
      File Added - 180714: script_cancellation_2.zip
      
      Logged In: YES 
      user_id=113501
      
      Fixed interp deletion issue, slave interp support, and some
      issues with commands that block (after, vwait).  Tweaked docs.
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. title changed to: "Script Cancellation with Tcl_CancelEval"
    5. username: "mistachkin"
  6. Ticket change [dd359f84c8] (rid 114624) by mistachkin on 2006-06-06 16:46:12:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      
      NOTE: This patch needs to be reviewed by kennykb and msofer.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  7. Ticket change [e1a2192f1f] (rid 87486) by mistachkin on 2006-06-09 16:07:52:

    1. icomment:
      
      
      File Added - 181083: script_cancellation_3.zip
      
      Logged In: YES 
      user_id=113501
      
      Attaching updated (v3) patch that works around the
      Tcl_GetMaster (bug #1502071) issue.
      
      The previous (v2) patch demonstrates the issue.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  8. Ticket change [08d22588bd] (rid 89628) by mistachkin on 2006-06-12 15:45:01:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      
      The v4 patch is basically code complete.  However, I'm still
      working on the documentation and test cases for [cancel].
      
      Quite a lot of fine tuning has been done to both the new
      code and the comments.  The Tcl_CancelEval function now
      accepts a new flag TCL_CANCEL_UNWIND that allows the
      evaluation stack for the target interpreter to be completely
      unwound in the event of the pathological test cases like:
      
      while {1} { catch { while {1} {incr x} } }
      
      Here are some other test cases that work correctly with the
      v4 patch:
      
      # Tcl_CancelEval after delay test
      # returns TCL_ERROR "eval cancelled" or "eval unwound" 
      # based on flags passed to Tcl_CancelEval
      after 30000
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval vwait test
      # returns TCL_ERROR "eval cancelled" or "eval unwound" 
      # based on flags passed to Tcl_CancelEval
      vwait forever
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval very tight loop test
      # returns TCL_ERROR "eval cancelled" or "eval unwound" 
      # based on flags passed to Tcl_CancelEval
      while {1} {}
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval tight loop with body test
      # returns TCL_ERROR "eval cancelled" or "eval unwound" 
      # based on flags passed to Tcl_CancelEval
      while {1} {incr x}
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval with TCL_CANCEL_UNWIND test.
      # This can only be cancelled if the TCL_CANCEL_UNWIND
      # flag is used with Tcl_CancelEval.  It will return 
      # TCL_ERROR "eval unwound" in that case.
      while {1} { catch { while {1} {incr x} } }
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval with TCL_CANCEL_UNWIND slightly more 
      # pathological unwind test
      # returns TCL_ERROR "eval unwound" 
      while {1} {
        catch { 
          while {1} {
            catch { 
              while {1} {incr x}
            } 
          } 
        } 
      }
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval slave interp test
      # returns TCL_ERROR "eval cancelled" or "eval unwound" 
      # based on flags passed to Tcl_CancelEval
      interp create foo; foo eval { while {1} {incr x} }
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval [subst] test
      # returns TCL_ERROR "eval cancelled" or "eval unwound" 
      # based on flags passed to Tcl_CancelEval
      subst {[while {1} {incr x}]}
      
      ----------------------------------------------------------
      
      # Tcl_CancelEval with TCL_CANCEL_UNWIND pathological slave 
      # interp test
      # returns TCL_ERROR "eval unwound"
      interp create foo; foo eval {
        while {1} {
          catch { 
            while {1} { 
              catch { 
                while {1} {incr x}
              }
            }
          } 
        } 
      }
      
      ----------------------------------------------------------
      
      # basic [cancel] test
      # returns TCL_ERROR "eval cancelled"
      cancel
      
      ----------------------------------------------------------
      
      # basic [cancel] test with "--"
      # returns TCL_ERROR "eval cancelled"
      cancel --
      
      ----------------------------------------------------------
      
      # basic [cancel -unwind] test
      # returns TCL_ERROR "eval unwound"
      cancel -unwind --
      
      ----------------------------------------------------------
      
      # [cancel] test
      # returns TCL_ERROR "eval cancelled"
      catch {unset foo i}
      while {1} {
        incr i; lappend foo $i
        # pretend this is some complex 
        # logic or Tk button command.
        if {$i > 3} then {cancel} 
      }
      
      ----------------------------------------------------------
      
      # [cancel -unwind] test
      # returns TCL_ERROR "eval unwound"
      catch {unset foo i}
      while {1} { 
        catch { 
          while {1} { 
            incr i; lappend foo $i
            # pretend this is some complex 
            # logic or Tk button command.
            if {$i > 3} then {cancel -unwind} 
          }
        } 
      }
      
      ----------------------------------------------------------
      
      # recursion test
      # returns TCL_ERROR "eval cancelled"
      proc foo { i } {
        if {$i > 10} then { 
          cancel 
        } else {
          return [foo [expr {$i + 1}]] 
        }
      }; foo 0
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  9. Ticket change [340524ecde] (rid 106692) by mistachkin on 2006-06-12 15:45:02:

    1. icomment:
      
      
      File Added - 181375: script_cancellation_4.zip
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  10. Ticket change [7a08e03169] (rid 90235) by mistachkin on 2006-06-13 16:01:05:

    1. icomment:
      
      
      File Added - 181487: script_cancellation_5.zip
      
      Logged In: YES 
      user_id=113501
      
      
      Updated (v5) patch supports a custom error message for
      script cancellation via Tcl_CancelEval and [cancel].  Also
      corrected mutex locking issue with CancelEvalProc.
      
      Here is a quick Tk example of [cancel] usage:
      
      ----------------------------------------------------
      
      package require Tk
      
      pack [text .clock] -side top -expand true \
              -fill both -padx 10 -pady 10
                         
      pack [button .go -padx 10 -pady 10 -text "Go" \
              -command [list goButton]] \
              -side left -padx 10 -pady 10
      pack [button .cancel -padx 10 -pady 10 -text "Cancel" \
              -command [list cancelButton "clock stopped."]] \
              -side right -padx 10 -pady 10
      
      proc goButton {args} {
        while {1} {
          catch {.clock delete 1.0 end}
          .clock insert end [clock format [clock seconds]]
          update
        }
      }
      
      proc cancelButton {msg} {
        cancel -unwind {} $msg
      }
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  11. Ticket change [c2810319c6] (rid 111496) by mistachkin on 2006-06-13 16:01:35:

    1. icomment:
      
      
      File Deleted - 181375: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  12. Ticket change [f36f5c3294] (rid 129715) by mistachkin on 2006-06-13 16:02:01:

    1. icomment:
      
      
      File Deleted - 181083: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  13. Ticket change [2ea3adfb65] (rid 92928) by mistachkin on 2006-06-18 07:55:23:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      Refactored error message handling to be simpler and more
      robust (v6).
      
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  14. Ticket change [ea578c35bb] (rid 103357) by mistachkin on 2006-06-18 07:55:24:

    1. icomment:
      
      
      File Added - 182033: script_cancellation_6.zip
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  15. Ticket change [6cb3ed2f29] (rid 128563) by mistachkin on 2006-06-18 07:55:38:

    1. icomment:
      
      
      File Deleted - 181487: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  16. Ticket change [bd5a738fed] (rid 101888) by mistachkin on 2006-07-11 11:45:12:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      
      Refreshed v6 patch against current HEAD (now v7).
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  17. Ticket change [fa8615a851] (rid 91893) by mistachkin on 2006-07-11 11:45:13:

    1. icomment:
      
      
      File Deleted - 182033: 
      
      
      
      File Added - 184503: script_cancellation_7.zip
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  18. Ticket change [e45a2f2c9d] (rid 87937) by mistachkin on 2006-08-31 14:36:21:

    1. icomment:
      
      
      File Deleted - 184503: 
      
      Logged In: YES 
      user_id=113501
      
      
      A new patch revision is forthcoming...
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  19. Ticket change [bde0848209] (rid 101984) by mistachkin on 2006-10-12 08:01:31:

    1. icomment:
      
      
      File Added - 197788: script_cancellation8.zip
      
      Logged In: YES 
      user_id=113501
      
      
      Latest patch is against HEAD and cleans up a few things.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  20. Ticket change [9b540e49c5] (rid 111101) by msofer on 2006-10-12 08:17:07:

    1. assignee changed to: "nobody"
    2. icomment:
      Logged In: YES 
      user_id=148712
      
      An almost 1500 loc patch without a spec, man page or tests.
      I'm not up to guessing what it is supposed to do, sorry.
      When the forthcoming tip does come forth, I'll take a look.
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. username: "msofer"
  21. Ticket change [af27480072] (rid 97759) by mistachkin on 2006-10-12 09:26:40:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      
      Sorry, I'm still working on the TIP, man pages, and tests.  
      
      In the meantime, the code fully works.  The basic
      functionality provided is the ability to cancel a script
      running in an interpreter from any thread in the process via
      Tcl_CancelEval or from within the interpreter itself via the
      [cancel] command.  Some examples are provided below.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  22. Ticket change [ee171e9177] (rid 104023) by mistachkin on 2006-10-16 14:12:07:

    1. assignee changed to: "msofer"
    2. icomment:
      
      
      File Deleted - 197788: 
      
      
      
      File Added - 198366: script_cancellation_9.zip
      
      Logged In: YES 
      user_id=113501
      
      
      New v9 patch.  More cleanup and consistency fixes, now
      complete with tests.  Docs for Tcl_Canceled and
      Tcl_CancelEval complete.  Still working on [cancel] docs. 
      TIP has been submitted and should be forthcoming.
      
      
      
    3. login: "mistachkin"
    4. mimetype: "text/plain"
    5. title changed to: "TIP: Script Cancellation with Tcl_CancelEval"
    6. username: "mistachkin"
  23. Ticket change [00407c6c94] (rid 119285) by mistachkin on 2006-10-17 06:24:44:

    1. title changed to: "TIP 285: Script Cancellation with Tcl_CancelEval"
  24. Ticket change [3b3a85c44a] (rid 112702) by mistachkin on 2006-10-17 21:51:45:

    1. icomment:
      
      
      File Deleted - 198366: 
      
      
      
      File Added - 198625: script_cancellation_10.zip
      
      Logged In: YES 
      user_id=113501
      
      
      New v10 patch, various adjustments, corrected whitespace.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  25. Ticket change [7be7f9342b] (rid 96985) by mistachkin on 2007-07-24 17:09:00:

    1. icomment:
      
      
      File Deleted - 198625: 
      
      
      
      File Added - 238301: script_cancellation_11.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      Updated (v11) patch to latest HEAD.
      
      File Added: script_cancellation_11.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  26. Ticket change [f4b8f9d6f0] (rid 129975) by mistachkin on 2007-12-13 13:52:12:

    1. icomment:
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      Patch needs to be updated for latest HEAD.  Also, the plan is to change the script visible command to [interp cancel] instead of [cancel].
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  27. Ticket change [ca1f86ed76] (rid 122406) by mistachkin on 2008-04-04 16:02:26:

    1. icomment:
      
      
      File Added - 273175: script_cancellation_12.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      Patch updated to latest HEAD.  
      
      Still need to change [cancel] to [interp cancel] and add docs for it.
      
      File Added: script_cancellation_12.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  28. Ticket change [27afe7d2cd] (rid 88563) by mistachkin on 2008-04-04 16:02:27:

    1. icomment:
      
      
      File Deleted - 238301: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  29. Ticket change [05c4c4abb6] (rid 89117) by mistachkin on 2008-04-04 17:36:24:

    1. icomment:
      
      
      File Added - 273192: script_cancellation_13.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      Patch updated.
      
      Changed [cancel] to [interp cancel] and added appropriate docs.
      
      File Added: script_cancellation_13.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  30. Ticket change [5386ff1370] (rid 93774) by mistachkin on 2008-04-04 17:36:25:

    1. icomment:
      
      
      File Deleted - 273175: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  31. Ticket change [c03b009aa7] (rid 102371) by mistachkin on 2008-04-05 02:14:54:

    1. icomment:
      
      
      File Deleted - 273192: 
      
      
      
      File Added - 273267: script_cancellation_14.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      Minor corrections.
      
      File Added: script_cancellation_14.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  32. Ticket change [449b0d2beb] (rid 116736) by mistachkin on 2008-04-05 09:49:00:

    1. icomment:
      
      
      File Deleted - 273267: 
      
      
      
      File Added - 273323: script_cancellation_15.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      More minor corrections.
      
      File Added: script_cancellation_15.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  33. Ticket change [3a619b9d33] (rid 112556) by mistachkin on 2008-04-05 11:11:25:

    1. icomment:
      
      
      File Added - 273326: tk_cancellation_1.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      Adding preliminary patch for Tk changes.
      
      File Added: tk_cancellation_1.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  34. Ticket change [c4d05fb13a] (rid 111899) by mistachkin on 2008-04-29 21:39:34:

    1. icomment:
      
      
      File Added - 276288: script_cancellation_16.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      Updated CANCELED interp flag to not use the previously used 0x10 value.
      
      File Added: script_cancellation_16.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  35. Ticket change [81bce54ffc] (rid 117093) by mistachkin on 2008-04-29 21:39:35:

    1. icomment:
      
      
      File Deleted - 273323: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  36. Ticket change [dc4f621cd2] (rid 114455) by mistachkin on 2008-05-15 12:37:06:

    1. icomment:
      
      
      File Added - 277853: tip285_v17.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      Updated to HEAD.  Minor enhancements and fixes.
      
      File Added: tip285_v17.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  37. Ticket change [7ae2a0ee49] (rid 90417) by mistachkin on 2008-05-15 12:37:11:

    1. icomment:
      
      
      File Deleted - 276288: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  38. Ticket change [c96e362a7a] (rid 122282) by mistachkin on 2008-05-15 12:37:15:

    1. icomment:
      
      
      File Deleted - 273326: 
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  39. Ticket change [cd50f72a70] (rid 95870) by mistachkin on 2008-05-16 10:39:47:

    1. icomment:
      
      
      File Deleted - 277853: 
      
      
      
      File Added - 277953: tip285_v18.zip
      
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      Updated, fixes to tests.
      
      File Added: tip285_v18.zip
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  40. Add attachment "tip285_v18.zip" [a50a1fd058] (rid 110307) by mistachkin on 2008-05-16 10:39:47.

  41. Ticket change [90f3234972] (rid 120543) by mistachkin on 2008-06-13 22:11:51:

    1. icomment:
      Logged In: YES 
      user_id=113501
      Originator: YES
      
      
      Updated and committed to HEAD.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  42. Ticket change [57dcbbfab6] (rid 117704) by mistachkin on 2008-06-13 22:11:52:

    1. assignee changed to: "mistachkin"
    2. closedate changed to: "2008-06-13T15:11:52"
    3. closer changed to: "mistachkin"
    4. resolution changed to: "Accepted"
    5. status changed to: "Closed"
  43. Ticket change [64b752a6a6] (rid 92817) by alsterg on 2009-12-27 15:55:57:

    1. icomment:
      The tip285_v18.zip file looks broken. Can you upload again?
      
      
    2. login: "alsterg"
    3. mimetype: "text/plain"
    4. username: "alsterg"
  44. Ticket change [076fbc22ba] (rid 89397) by mistachkin on 2009-12-27 16:12:56:

    1. icomment:
      I can try to find the patch and re-upload it; however, the functionality is already present in HEAD.
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  45. Ticket change [e0213d4f9a] (rid 115142) by mistachkin on 2009-12-27 16:13:55:

    1. icomment:
      Just tested the attached ZIP file.  It opens and validates OK.
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"