Skip to content
Tcl Source Code History Of Ticket ac7592e73c10d04b
Login

History Of Ticket ac7592e73c10d04b

Artifacts Associated With Ticket ac7592e73c10d04b

  1. Ticket change [5858e6350d] (rid 223993) by pooryorick on 2024-04-01 00:20:08:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      The following script derived from an example provided in
      [de232b49f26da1c1], never completes.
      
      <code><verbatim>
          namespace eval refchan {
      	namespace ensemble create
      	namespace export *
      
      	proc finalize {chan args} {
      	    namespace delete c_$chan
      	}
      
      	proc initialize {chan args} {
      	    namespace eval c_$chan {}
      	    namespace upvar c_$chan watching watching
      	    set watching {}
      	    list finalize initialize seek watch write
      	}
      
      	proc watch {chan args} {
      	    namespace upvar c_$chan watching watching
      	    foreach arg $args {
      		switch $arg {
      		    write {
      			if {$arg ni $watching} {
      			    lappend watching $arg
      			}
      			after idle after 0 chan postevent $chan $arg
      		    }
      		}
      	    }
      	}
      
      	proc write {chan args} {
      	    incr ::counter
      	    after idle after 0 chan postevent $chan write
      	    return 1
      	}
          }
      
          set f [chan create w [namespace which refchan]]
          chan configure $f -blocking 0
          chan event $f writable [namespace code {
      	puts $f X
          }]
      
          variable x {}
      
          apply [list {} {
      	set script {
      	    set lambda [list ::apply [list script {
      		variable count
      		variable x
      		if {[incr count] < 1000} {
      		    try $script
      		} else {
      		    set x done
      		}
      	    } [namespace current]] $script]
      	    after idle [list after 0 $lambda]
      	}
      	try $script
          } [namespace current]]
      
      
          set token [after 10000 [namespace code {
      	set x timeout
          }]]
          vwait [namespace which -variable x]
          return $x
      </verbatim></code>
      
      
      This is because TclIO.c/ChannelTimerProc() keeps scheduling adding a an
      event to the front of the standard queue.
      
    5. is_private initialized to: "0"
    6. login: "pooryorick"
    7. priority initialized to: "5 Medium"
    8. private_contact initialized to: "2b2275eab1118e1fab0016cf1c5702893c6af86c"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "pooryorick"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to: "idle events are never processed when"
    15. type initialized to: "Bug"
  2. Ticket change [56e49d02e6] (rid 223994) by pooryorick on 2024-04-01 00:22:16:

    1. login: "pooryorick"
    2. mimetype: "text/plain"
    3. title changed to:
      idle events are never processed when a "writable" handler on a nonblocking channel dominates the event queue
      
  3. Ticket change [e18b556924] (rid 224000) by pooryorick on 2024-04-01 00:26:13:

    1. icomment:
      Fixed in [b2d083e9e04e492d] by having tclIO.c/ChannelTimerProc() us the idle queue instead of the standard queue to reschedule itself.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  4. Ticket change [20b0757dc5] (rid 224003) by apnadkarni on 2024-04-01 06:09:18:

    1. icomment:
      I'm unhappy about your making changes to the **trunk** on a point of dispute before there is some level of consensus on the fix. It makes reverting potentially painful for everyone else. Please move it to a bugfix branch.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  5. Ticket change [6265d93fae] (rid 224004) by apnadkarni on 2024-04-01 06:11:07:

    1. icomment:
      I'll continue in ticket [de232b49f2] later this evening when I have time.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-fossil-plain"
  6. Ticket change [fdb1c69c33] (rid 224005) by pooryorick on 2024-04-01 07:49:23:

    1. icomment:
      This fix doesn't stop us from continuing in any direction we decide on later.  <code>ChannelTimerProc()</code> and the timer itself can be removed if there's a good alternative.  Fixing this issue in the meantime just gets it out of the way so it doesn't muddy the arguments.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [f1ba6978a1] (rid 224027) by jan.nijtmans on 2024-04-01 19:50:26:

    1. assignee changed to: "pooryorick"
    2. icomment:
      Running testsuite (MacOS, --enable-symbols=mem), I see:
      <pre>
      io.test
      Test file error: can not find reflected channel named "rc6"
          while executing
      "chan postevent rc6 write"
          ("after" script)
      can not find reflected channel named "rc6"
          while executing
      "chan postevent rc6 write"
          ("after" script)
      ioCmd.test
      </pre>
      
      This means, that this 'fix' blocks dgp's work in trying to release 9.0b2. I see no other way than moving it to a branch.
      
      Also, I already merged the implementation of TIP #688 to trunk, only after that I saw this problem. So, it means extra work for me too. Thanks! (not)
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
  8. Ticket change [3900d0b49b] (rid 224076) by pooryorick on 2024-04-01 22:58:18:

    1. icomment:
      This branch only fails on Windows and Mac systems, and I don't have such systems to test changes on.  How can I get the Github CI system to test this branch so that I can get feedback and fix the issue?
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [6acf1e6ede] (rid 224079) by apnadkarni on 2024-04-02 03:19:39:

    1. icomment:
      I wrote my concerns with this change in [934bb3a69d].
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  10. Ticket change [507fa8692c] (rid 224080) by apnadkarni on 2024-04-02 03:22:41:

    1. icomment:
      Nathan,
      
      *How can I get the Github CI system to test this branch so that I can get feedback and fix the issue?*
      
      What I have done in the past is to clone the repository (on github) and hack the github action workflow settings.
      
      I'm not sure there is an easier way. Testing all branches has proved problematic in the past because of the number of jobs generated (or something)
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  11. Ticket change [3da9741770] (rid 224090) by jan.nijtmans on 2024-04-02 11:37:48:

    1. icomment:
      > This branch only fails on Windows and Mac systems, and I don't have such systems to test changes on. How can I get the Github CI system to test this branch so that I can get feedback and fix the issue?
      
      Sometimes, it fails on Linux too: Proof:
      
      [https://github.com/tcltk/tcl/actions/runs/8518905746/job/23331906451]
      
      You can build any branch on GITHUB, by adding a tag "core-*" to the commit you want to build (in fossil). That's how I managed to build your "bug-ac7592e73c10d04b" branch there, by adding "core-bug-ac7592e73c10d04b" ;-)
      
      (don't forget to remove it the next day...)
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  12. Ticket change [9c0c794e6c] (rid 224094) by pooryorick on 2024-04-02 11:57:33:

    1. icomment:
      Jan, thanks for the TIP!  I had just cloned the Tcl repository, and had noticed that too.  Perhaps another prefix like "ci-" could also be reserved for that purpose.
      
      Regarding that error, I had already fixed that in a later commit that I also merged to trunk, and you reverted it along with the earlier commits.  However, I hadn't fixed the other error that is showing up only on Windows and Mac, so that's ok, and that I'm looking into those errors now.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  13. Ticket change [caa3fb65e1] (rid 224095) by jan.nijtmans on 2024-04-02 12:10:23:

    1. icomment:
      > Regarding that error, I had already fixed that in a later commit that I also merged to trunk, and you reverted it along with the earlier commits.
      
      I saw that later commit, it doesn't fix the problem!
      
      > and that I'm looking into those errors now.
      Please don't bother. I have the same concerns as Ashok. Your commits on trunk hinder dgp's work on Tcl 9.0b2.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  14. Ticket change [875613751a] (rid 224097) by sebres on 2024-04-02 12:49:02:

    1. icomment:
      I don't think [0feb3d12b6] is a good approach: replacement synthetic timer with an idle event is still more worse - a writable event is an IO-event and so shall be never considered as an idle event.
      It is very bad for all systems, e. g. with own event-cycle, that may retard idle events, so executing them only in idle state of thread.
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  15. Ticket change [c049068da9] (rid 224098) by pooryorick on 2024-04-02 13:39:36:

    1. icomment:
      I an IO event should never be considered as an idle event, then Ashok's idea of requiring that refchans user <code>[after 0 [list after idle]]</code> is a bad idea too.  But with the way that the idle works in Tcl, I'm not sure that sebres' criticism is valid.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  16. Ticket change [17539e3c75] (rid 224103) by sebres on 2024-04-02 14:02:48:

    1. icomment:
      This issue is even a typical example where idle events will be and can be disadvantaged (if you have many "normal" events, idle event is never happen and it is good so... well, it was good till [0feb3d12b6]).
      
      But take a look at Tcl_DoOneEvent (and flag TCL_IDLE_EVENTS). 
      An event cycle of typical reactor (N threads x M interpreters) can and mostly will invoke Tcl_DoOneEvent without TCL_IDLE_EVENTS in main cycle and would invoke it with TCL_IDLE_EVENTS in some helper depending on load (e. g. periodically).
      
      Anyway it is not idle and my critic is valid for many reasons, no matter how, you think, the idle may work in Tcl (because often it doesn't work in this way).
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  17. Ticket change [a9a831df07] (rid 224356) by apnadkarni on 2024-04-08 02:33:04:

    1. icomment:
      Nathan wrote: *I an IO event should never be considered as an idle event, then Ashok's idea of requiring that refchans user [after 0 [list after idle]] is a bad idea too. But with the way that the idle works in Tcl, I'm not sure that sebres' criticism is valid.*
      
      I do not recall suggesting "after 0 after idle" and cannot find where I wrote that. I thought I wrote "after idle after 0". If I did state the former, it was in error and should have been the latter.
      
      If processing events off the event queue, and desiring to reschedule again off the event queue without starving the idle queue, my thinking is that "after idle after 0" is the correct idiom. Conversely, "after 0 after idle" if running on the idle queue and rescheduling back on the idle queue without starving the event queue.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  18. Ticket change [140e8197b2] (rid 224504) by pooryorick on 2024-04-10 16:17:44:

    1. icomment:
      For the purpose of this discussion, it doesn't make any difference whether it's
      
      	<code>after 0 [list after idle]</code>
      
      or 
      
      	<code>after idle [list after 0]</code>
      
      .  The question is whether or not to get the idle queue involved in handling
      events for channels, and sebres' answer was "no".
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  19. Ticket change [0ebe96e586] (rid 235280) by jan.nijtmans on 2024-11-21 13:26:27:

    1. closedate changed to: "2460636.06004054"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      Related to [de232b49f2] (See comment below 2024-04-01 06:11:07), so can be closed.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"