Re: Event loop and http::geturl

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Event loop and http::geturl
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.lang.tcl
Date : 27. Jun 2025, 17:18:32
Autres entêtes
Message-ID : <ygav7ohyx7r.fsf@akutech.de>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
* Christian Gollwitzer <auriocus@gmx.de>
| Am 26.06.25 um 23:02 schrieb et99:
| > I wonder, if you are reading a file that is being written from
| > another process, sort of like a "tail" program, doesn't tcl's
| > [fileevent
| > <channel> readable <script>] trigger constantly? Isn't this in
| > effect a tight polling loop?
>
| The underlying mechanism is select() or poll(). To my knowledge, this
| only works for pipes/sockets, not for files.

select() also works for files, the effect is that it indeed triggers
immediately on each call.

     man select(2)
     [...]
       readfds
              The file descriptors in this set are watched to see if they  are
              ready  for reading.
          **  A file descriptor is ready for reading if a read operation will not block;
              in particular, a file  descriptor is also ready on end-of-file.

(** emphasis by me).

The effect in TCL of setting a readable-fileevent on a regular disk file
is indeed that the event fires repeatedly until EOF, blocking any GUI
updates which would run "after idle".

R'

Date Sujet#  Auteur
23 Jun 25 * Event loop and http::geturl17Jonathan Kelly
23 Jun 25 +- Re: Event loop and http::geturl1Jonathan Kelly
24 Jun 25 `* Re: Event loop and http::geturl15Rich
24 Jun 25  `* Re: Event loop and http::geturl14Jonathan Kelly
25 Jun 25   `* Re: Event loop and http::geturl13et99
25 Jun 25    `* Re: Event loop and http::geturl12et99
25 Jun 25     `* Re: Event loop and http::geturl11et99
25 Jun 25      `* Re: Event loop and http::geturl10Jonathan Kelly
25 Jun 25       `* Re: Event loop and http::geturl9Rich
26 Jun 25        `* Re: Event loop and http::geturl8et99
26 Jun 25         +* File processing (was Event loop and http::geturl)2Alan Grunwald
26 Jun 25         i`- Re: File processing (was Event loop and http::geturl)1Ralf Fassel
26 Jun 25         `* Re: Event loop and http::geturl5Rich
26 Jun 25          `* Re: Event loop and http::geturl4Jonathan Kelly
26 Jun 25           `* Re: Event loop and http::geturl3et99
27 Jun 25            `* Re: Event loop and http::geturl2Christian Gollwitzer
27 Jun 25             `- Re: Event loop and http::geturl1Ralf Fassel

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal