Feature #4849

io/wait should have a way to avoid FIONREAD

Added by Eric Wong about 4 years ago. Updated 4 months ago.

[ruby-core:36805]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada

Description

I would like an API method for io/wait which bypasses FIONREAD. Some IO
objects I work with (e.g. Linux eventfd[1]) to not support FIONREAD.

I can implement any proposed API for io/wait, but I don't know what it should
be. Perhaps just "IO#wait_readable", since I also have
http://redmine.ruby-lang.org/issues/4646 open for IO#wait_writable.

Meanwhile, I will use IO.select. I believe IO#wait_* will be a better
API that is easier-to-use and potentially faster (it can bypass array
scanning and use poll() for high FDs in Linux).

[1] http://bogomips.org/sleepy_penguin/SleepyPenguin/EventFD.html

Associated revisions

Revision 50262
Added by Nobuyoshi Nakada 4 months ago

wait.c: poll over nread

  • ext/io/wait/wait.c (io_ready_p, io_wait_readable): try polling first and check FIONREAD optionally to see if EOF. [Feature #4849]

History

#1 Updated by Yusuke Endoh over 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

#2 Updated by Yusuke Endoh over 2 years ago

  • Target version changed from 2.0.0 to next minor

#3 Updated by Nobuyoshi Nakada 4 months ago

  • % Done changed from 0 to 100
  • Status changed from Assigned to Closed

Applied in changeset r50262.


wait.c: poll over nread

  • ext/io/wait/wait.c (io_ready_p, io_wait_readable): try polling first and check FIONREAD optionally to see if EOF. [Feature #4849]

Also available in: Atom PDF