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

Re: [PATCH 1/2] run-parallel: rename set_nonblocking to set_nonblocking_or_die

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 5, 2015, 06:19 UTC
Message-ID
<xmqq8u6d7ytc.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqfv0l7z2r.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> Torsten Bögershausen <tboegi@web.de> writes:
>
>> (Jumping into an old discussion, I may be off topic)
>
> I think this is exactly the latest "I wonder" from Peff, to which I
> said "well, perhaps we didn't need nonblock after all from the
> beginning".
>
>> And this work regardless if the fd blocking or not, so from that point of view,
>> the set_nonblocking() is not needed at all.
>>
>> The major question is, if the poll() works under Windows, (and I
>> haven't found time to dig further)
>
> ;-)

Having read your message, I notice these disturbing passages in my copy of manual pages.

poll(2) has
    BUGS
           See the discussion of spurious readiness notifications under
           the BUGS section of select(2).
and then select(2) has
       Under Linux, select() may report a socket file descriptor as
       "ready for read‐ ing", while nevertheless a subsequent read
       blocks.  This could for example happen when data has arrived
       but upon examination has wrong checksum and is discarded.
       There may be other circumstances in which a file descriptor
       is spuriously reported as ready.  Thus it may be safer to use
       O_NONBLOCK on sock‐ ets that should not block.

The world is not all Linux, so there may be systems that we do not have to worry about the bug described here, but there still are some Linux systems in use in the world, so we cannot assume the bug described above will not matter, either.

So I am not convinced that set_nonblocking() is unnecessary X-<.
Previous: Junio C HamanoNext: Jeff King
Message 16 of 18 in “git.git as of tonight”
  1. Junio C HamanoNov 2, 2015
  2. Johannes SixtNov 2, 2015
  3. Junio C HamanoNov 2, 2015
  4. Stefan BellerNov 2, 2015
  5. Johannes SixtNov 3, 2015
  6. Junio C HamanoNov 3, 2015
  7. Stefan BellerNov 3, 2015
  8. Johannes SixtNov 3, 2015
  9. Stefan BellerNov 3, 2015
  10. Torsten BögershausenNov 4, 2015
  11. Stefan BellerNov 4, 2015
  12. 0/2 Missing O_NONBLOCK under Windows (was: git.git as of tonight)Stefan Beller, Nov 4, 2015
  13. 1/2 run-parallel: rename set_nonblocking to set_nonblocking_or_dieStefan Beller, Nov 4, 2015
  14. Torsten BögershausenNov 5, 2015
  15. Junio C HamanoNov 5, 2015
  16. Junio C HamanoNov 5, 2015
  17. Jeff KingNov 5, 2015
  18. 2/2 run-parallel: Run sequential if nonblocking I/O is unavailableStefan Beller, Nov 4, 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.