Project

General

Profile

Actions

Feature #11145

closed

[PATCH] socket: avoid redundant fcntl with MSG_DONTWAIT

Added by normalperson (Eric Wong) almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Target version:
-
[ruby-core:69154]

Description

MSG_DONTWAIT is enough to force non-blocking I/O under Linux,
so avoid changing the state of a socket. This will allow certain
threads to do a non-destructive non-blocking "peek" while others
block (without relying on an extra ppoll syscall).

I suspect any OS with the MSG_DONTWAIT flag implements it correctly. AFAIK,
MSG_DONTWAIT is only on FreeBSD and Linux, and I've only tested on Linux.

  • ext/socket/init.c (rsock_s_recvfrom_nonblock): avoid redundant fcntl

Files

Actions

Also available in: Atom PDF

Like0
Like0Like0