lkml.org 
[lkml]   [2009]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pipe: don't block after data has been written
> > Welcome to real world.
>
> Yes in the real world there are bugs. The decision is to choose which
> bug you are going to expose. If it was my decision I would make the code
> work as documented, as Max wants to do.

Outside of academia the reality is fairly simple. A system needs to
behave according to the expected behaviour. That is a mix of things
- Standards
- Extrapolation (applying the logic of the standard to cases beyond it)
- Tradition (things that used to work still work)

If you like: How it is defined to work, how it is expected to work and how
it worked last year.

Tradition is a suprisingly large part of it. In the unix world that
tradition includes things like "signals do not interrupt disk I/O writes
causing short writes".

Pipes however is pretty much pure standards behaviour

In blocking mode they block
In non-blocking mode they don't block

Furthermore there are specific rules about writes under a certain size
always occurring in an atomic manner.

> In fact I think that Linux will already do short writes if a signal is
> received without restart set for the handler. I found several bugs last
> year in glibc and libstdc++ fwrite and iostreams regarding that.

The kernel takes great pains not to do this in the cases where tradition
dictates otherwise (notably in disk I/O)

Alan


\
 
 \ /
  Last update: 2009-11-05 19:33    [W:0.041 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site