Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b9c8e0111c6fc7afe8ad1a8bc159605bd45adb4a56f83725dacb0e8c02ae25bd
Ticket: 18f4a94d03b075c6295903f1f7b80f7e15b156d6
8.7 : a blocking memory channel no longer works.
User & Date: pooryorick on 2021-06-16 10:30:32
Changes

  1. closer changed to: "nobody"
  2. icomment:
    The behaviour this report describes is not a bug.  The provided test sets an
    event handler but then never enters the event loop:
    
    <code><verbatim>
    fileevent $ch readable [list ::memsock::readhandler $ch $port $handler]
    </verbatim></code>
    
    This behaviour is not supported.  Ad event handler on a channel can not not be
    processed until the event loop is entered.  The example may have worked in
    previous versions of Tcl, but only because of the bug described in
    [67a5eabbd3d19591] and [ef28eb1f1516|TCL_FILE_EVENTS cannot drive async I/O
    alone].
    
    In the attached "memsock.test" example, "sendget" relies on this event handler
    noted above to ferry data between the sending channel and the receiving
    channel.  This is an error.  That handler should  not be activated until the
    event loop is entered.
    
    This "memsock.test" example attached to this report is in essence a restatment
    of [67a5eabbd3d19591|refchan, coroutine, and postevent from the "watch" proc],
    and that issue was already fixed.  Unfortunately, in response to this new
    issue, that fix was reverted, effectively unfixing issue [67a5eabbd3d19591],
    and therefore unfixing the real bug illustreated by "memsock.test".  The work
    that was reverted represents an important change in the direction of correcting
    some fundamental issues in Tcl's IO subsystem.  That work should be reinstated
    immediately so that it makes it into the 8.7 release.
    
    There may indeed be an outstanding issue regarding writing to a nonblocking
    channel and then attempting to immediately read from it, but such an issue can
    be fixed far more gracefully than by making the revert in question.
    
  3. login: "pooryorick"
  4. mimetype: "text/x-fossil-wiki"
  5. resolution changed to: "Invalid"
  6. status changed to: "Open"