Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #206545

Re: Flushing all Buffers Before Exiting

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: Flushing all Buffers Before Exiting
Date 2019-03-24 17:20 +0100
Message-ID <xFe0O-3m7-13@gated-at.bofh.it> (permalink)
References (3 earlier) <xEaLD-5tc-3@gated-at.bofh.it> <xEgHn-BF-3@gated-at.bofh.it> <xEvwJ-1ex-1@gated-at.bofh.it> <xEQKS-5Xo-3@gated-at.bofh.it> <xESD1-76c-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat 23 Mar 2019 at 18:23:47 (+0100), tomas@tuxteam.de wrote:
> On Sat, Mar 23, 2019 at 10:27:01AM -0500, David Wright wrote:
> > On Fri 22 Mar 2019 at 17:45:50 (+0100), tomas@tuxteam.de wrote:
> 
> > Reading the OP's problem, I wonder how you're meant to detect
> > "any whiff of a problem" [...]
> 
> Torture tests.

Like, multiply the number of sources by stealing a few more radio
scanners to connect up, which then all burst into life as the
police scour the neighbourhood for thieves?

When dealing with realtime real information coming in, over which you
have no control, it can be non-trivial to set up such scenarios.
That's why I thought it best to devise a method that's more
efficient than line buffering. After all, that's why buffering
was invented, wasn't it.

> > The main concern raised in the OP was flushing before termination,
> > for which a signal is ideal. And for best performance, I'd forget
> > tee and just look at the output file occasionally, with tail.
> 
> A signal handler is definitely an option, but it can be pretty tricky.
> Especially if you are catching things like SEGV (you dare a write()
> after that?)

SIGUSR1 to flush the buffers; that's all (see Subject line). If you
find progamming it tricky, that's a good reason for line buffering as
a stopgap. What would I do with SEGV, having trapped it? (Or most of
the other signals…)

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Flushing all Buffers Before Exiting "Martin McCormick" <martin.m@suddenlink.net> - 2019-03-21 15:10 +0100
  Re: Flushing all Buffers Before Exiting Kenneth Parker <sea7kenp@gmail.com> - 2019-03-21 15:40 +0100
    Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-21 16:20 +0100
      Re: Flushing all Buffers Before Exiting Curt <curty@free.fr> - 2019-03-21 19:10 +0100
        Re: Flushing all Buffers Before Exiting Greg Wooledge <wooledg@eeg.ccf.org> - 2019-03-21 19:20 +0100
        Re: Flushing all Buffers Before Exiting Luís Gomes <luismsgomes@gmail.com> - 2019-03-21 19:30 +0100
    Re: Flushing all Buffers Before Exiting "Martin McCormick" <martin.m@suddenlink.net> - 2019-03-21 17:40 +0100
      Re: Flushing all Buffers Before Exiting Greg Wooledge <wooledg@eeg.ccf.org> - 2019-03-21 17:50 +0100
        Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-21 18:30 +0100
      Re: Flushing all Buffers Before Exiting David Wright <deblis@lionunicorn.co.uk> - 2019-03-21 19:40 +0100
        Re: Flushing all Buffers Before Exiting "Martin McCormick" <martin.m@suddenlink.net> - 2019-03-22 02:00 +0100
          Re: Flushing all Buffers Before Exiting deloptes <deloptes@gmail.com> - 2019-03-22 06:20 +0100
          Re: Flushing all Buffers Before Exiting "Jeremy Nicoll" <jn.ml.dbn.25@letterboxes.org> - 2019-03-22 17:40 +0100
          Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-22 17:50 +0100
            Re: Flushing all Buffers Before Exiting David Wright <deblis@lionunicorn.co.uk> - 2019-03-23 16:30 +0100
              Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-23 18:30 +0100
                Re: Flushing all Buffers Before Exiting David Wright <deblis@lionunicorn.co.uk> - 2019-03-24 17:20 +0100
                Re: Flushing all Buffers Before Exiting "Martin McCormick" <martin.m@suddenlink.net> - 2019-03-24 19:30 +0100
                Re: Flushing all Buffers Before Exiting Gene Heskett <gheskett@shentel.net> - 2019-03-24 20:00 +0100
                Re: Flushing all Buffers Before Exiting deloptes <deloptes@gmail.com> - 2019-03-24 21:40 +0100
                Re: Flushing all Buffers Before Exiting "Martin McCormick" <martin.m@suddenlink.net> - 2019-03-25 03:00 +0100
                Re: Flushing all Buffers Before Exiting deloptes <deloptes@gmail.com> - 2019-03-25 07:20 +0100
                Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-25 10:50 +0100
                Re: Flushing all Buffers Before Exiting David Wright <deblis@lionunicorn.co.uk> - 2019-03-26 17:50 +0100
                Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-26 18:00 +0100
                Re: Flushing all Buffers Before Exiting Curt <curty@free.fr> - 2019-03-26 18:40 +0100
                Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-26 19:00 +0100
                Re: Flushing all Buffers Before Exiting David Wright <deblis@lionunicorn.co.uk> - 2019-03-27 16:00 +0100
                Re: Flushing all Buffers Before Exiting <tomas@tuxteam.de> - 2019-03-27 16:20 +0100
  Re: Flushing all Buffers Before Exiting Lee <ler762@gmail.com> - 2019-03-21 19:50 +0100
    Re: Flushing all Buffers Before Exiting "Martin McCormick" <martin.m@suddenlink.net> - 2019-03-23 22:40 +0100

csiph-web