Re: serving a file to a client --- background fcopy read fileevent event puts socket channel blocking nonblocking



In article
<3c69be6e-ce92-4f23-9103-48da5f1fbdda@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
vitick@xxxxxxxxx wrote:

It looks like the only way to reliably do what I was trying to do is
to learn the Threads extension of TCL.

May I propose a better way? Learn how to work *with* the event loop
rather than fighting it. Start small. Try doing one thing, and post
here your solution. If feedback from some of the more experienced folk
here is positive, add one more thing, post here, repeat.

Based on the code you posted already, it's likely that feedback will
take the form of constructive suggestions on what to change in order to
make it work better. For example, I can think of no good reason *ever*
to write an infinite loop in an interactive Tcl application. I think
you might find that there is a teeny bit of misunderstanding on your
part regarding the "proper" way to do event-driven programming.
.



Relevant Pages

  • Re: serving a file to a client --- background fcopy read fileevent event puts socket cha
    ... to learn the Threads extension of TCL. ... Learn how to work *with* the event loop ... to write an infinite loop in an interactive Tcl application. ...
    (comp.lang.tcl)
  • Re: the loop event
    ... After your main thread has initialized Tcl. ... script which should be inserted into the event loop before running the ... LPASYNCEVENT ae; ... If you plan on turning Tcl's event loop into an alertable queue to ...
    (comp.lang.tcl)
  • Handling asynchronous hardware events
    ... I'd like to use TCL to control my devices over the GPIB/IEEE488.1 serial bus. ... For example I'm not allowed to call stdio functions in this handler, so typically one needs to send a message with SetEventon Windows and checks with WaitForEventin the main loop to handle the request. ... Can someone provide me with a simple example, what functions have to be called in the interrupt handler to queue an event, unblock the event loop, and how to register event handling on the Tcl level. ...
    (comp.lang.tcl)
  • Re: File Descriptors
    ... >engineer by training who got involved in microprocessors & microcontrollers ... >> (it belongs to Tcl now, rather than being exclusive to Tk, ... Its event loop is one of Tcl's glories. ... event processing, and, when told it's a strength of Tcl, emit ...
    (comp.lang.tcl)
  • Re: Handling asynchronous hardware events
    ... I'd like to use TCL (and especially its event loop) to control my ... In C I can install an asynchronous handler, ... I'd like to use Tcl and events instead, e.g. fire an event and provide ... event, unblock the event loop, and how to register event handling on ...
    (comp.lang.tcl)