lkml.org 
[lkml]   [1999]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    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
    down_interruptible()?
    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.

    --
    Manfred

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

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