NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/43199: read(2) returns bad size in multithreaded programs



The following reply was made to PR kern/43199; it has been noted by GNATS.

From: Jason Thorpe <thorpej%shagadelic.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/43199: read(2) returns bad size in multithreaded programs
Date: Fri, 23 Apr 2010 08:03:27 -0700

 On Apr 23, 2010, at 7:55 AM, Wolfgang.Stukenbrock%nagler-company.com@localhost 
=
 wrote:
 
 >      The problem seem to happen if multiple threads are reading from =
 the same fd at the
 >      same time. This does not make much sence of cause, but if an =
 application decides
 >      to such a thing, the kernel may not run wild.
 
 That all depends on that sort of file descriptor it is and how you read =
 from it.  If it is a regular file, the behavior is non-deterministic =
 unless you use pread(2).  If it is a socket, correct behavior requires =
 exclusive access to the socket for the duration of the read(2) call.
 
 However, I do agree that it should not return a value larger than the =
 requested size.
 
 -- thorpej
 


Home | Main Index | Thread Index | Old Index