git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] reduce progress updates in background

From
Luke Mewburn <luke@mewburn.net>
Date
Apr 14, 2015, 11:08 UTC
Message-ID
<20150414110814.GF23475@mewburn.net>
In-Reply-To
<alpine.LFD.2.11.1504131052090.5619@knanqh.ubzr>
On Mon, Apr 13, 2015 at 11:01:04AM -0400, Nicolas Pitre wrote:
  | > That's what happens; the suppression only occurs if the process is
  | > currently background.  If I start a long-running operation (such as "git
  | > fsck"), the progress is displayed. I then suspend & background, and the
  | > progress is suppressed.  If I resume the process in the foreground, the
  | > progress starts to display again at the appropriate point.
  | 
  | I agree. I was just comenting on your suggestion about caching the 
  | in_progress_fd() result which would prevent that.

Ahh. My suggestion about is_foreground_fd() result caching within struct progress was only about caching the getpgid(0) portion of the test (as that's not expected to change for the life of the process), and not the tcgetpgrp(fd) portion. I.e, add 'int curpgid' to struct progress, set that to getpgid(0) in start_progress_display(), and compare tcgetpgrp(fd) against progress->curpgid.

In any case, I think it's a micro optimisation not worth worrying about at this point, given is_foreground_fd() is only called each time the output would change, per your feedback.

regards, Luke.

Previous: Luke MewburnNext: brian m. carlson
Message 18 of 20 in “reduce progress updates in background”
  1. reduce progress updates in backgroundLuke Mewburn, Apr 13, 2015
  2. Nicolas PitreApr 13, 2015
  3. Luke MewburnApr 13, 2015
  4. Nicolas PitreApr 13, 2015
  5. reduce progress updates in backgroundLuke Mewburn, Apr 14, 2015
  6. Nicolas PitreApr 14, 2015
  7. compat/mingw: stubs for getpgid() and tcgetpgrp()Johannes Sixt, Apr 15, 2015
  8. Junio C HamanoApr 15, 2015
  9. Johannes SixtApr 15, 2015
  10. Johannes SchindelinApr 16, 2015
  11. Junio C HamanoApr 16, 2015
  12. Erik Faye-LundApr 15, 2015
  13. Johannes SchindelinApr 16, 2015
  14. rupert thurnerApr 23, 2015
  15. rupert thurnerApr 24, 2015
  16. Johannes SchindelinApr 24, 2015
  17. Luke MewburnApr 17, 2015
  18. Luke MewburnApr 14, 2015
  19. brian m. carlsonApr 14, 2015
  20. Johannes SchindelinApr 14, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.