[lkml]   [1999]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Subjectpipes & O_NONBLOCK
    I noticed that if a pipe is opened with O_NONBLOCK, then pipe_read()
    calls down_trylock(), and pipe_write() calls down_interruptible().

    Why does pipe_read() call down_trylock() instead of
    If the pipe buffer is full, and 2 thread try to read 10 bytes, then the
    current code would return -EAGAIN for one of the calls. I'm not sure,
    but this seems wrong.

    Obviously, pipe_read() with O_NONBLOCK must not wait for new data from
    user space, but since POSIX allows preemptive multitasking, the kernel
    can schedule() around without violating the standard.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:53    [W:0.017 / U:1.860 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site