push_read bug on linux?

Chia-liang Kao clkao at clkao.org
Sat Sep 18 11:48:37 CEST 2010


On 18 September 2010 15:42, Marc Lehmann <schmorp at schmorp.de> wrote:
> On Sat, Sep 18, 2010 at 09:56:29AM +0800, Chia-liang Kao <clkao at clkao.org> wrote:
>> just run it with a large newline-separated file as ARGV, and it will
>
> The bug is in your usage - nonblocking operations with files are
> completely nonsensical (what are you trying to achieve?) and therefore not
> supported by AnyEvent::Handle (or AnyEvent fort hat matter (or the linux
> kernel for that matter)).

ok, please excuse my ignorance about file io does not support
nonblocking operations.

the use case is in a nonblocking server, a user might request
incremental process of a large file.  buffering the while file would
block the server, so I install a line reader for the file, and use the
callback to process fragments of the data that is available to send to
users.  It was probably naive for me to assume that the event loop
will just check the file's rflag and do the scheduling of that reader
callback and the rest of the server logic.

What would you suggest to do in such case?

Cheers,
CLK



More information about the anyevent mailing list