lkml.org 
[lkml]   [2007]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Improving read/write/close system call reliability when used with pthreads
Date
David,

True. Even though there is a point in making the kernel detect and
behave consistently in this case applications (often) end up with
their own mess they cannot easily handle. A few more use cases would
now work OK but probably not enough to make the improvement worthwhile.

Thanks,
Fredrik

13 aug 2007 kl. 05.14 skrev David Schwartz:
> Since there's no atomic "unlock and read" function, any code that
> could ever
> close a socket in one thread while another thread is blocked on
> read might
> call close just before another thread blocks in read. Nothing stops
> another
> thread from opening something, getting the same file descriptor,
> and then
> allowing the thread to call "read" on the wrong file descriptor
> entirely.
>
> Since this can never be made sane in general, I see little point in
> making
> one variation of what can go wrong a bit saner. It is still
> irresponsible to
> code like this.
>
> DS
>
>
>

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

\
 
 \ /
  Last update: 2007-08-13 14:31    [W:0.048 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site