Date: Tue, 2 Dec 1997 13:54:58 -0500 (EST) From: "John S. Dyson" <toor@dyson.iquest.net> To: tlambert@primenet.com (Terry Lambert) Cc: dyson@freebsd.org, tlambert@primenet.com, toor@dyson.iquest.net, current@freebsd.org Subject: Re: FYI: usage of new AIO calls Message-ID: <199712021854.NAA02027@dyson.iquest.net> In-Reply-To: <199712021848.LAA18076@usr04.primenet.com> from Terry Lambert at "Dec 2, 97 06:48:54 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert said: > > BTW, I also plan to implement pread/pwrite, but haven't decided to > > implement as a kernel call, or as a section (3) subroutine. (Those > > are less of an issue though.) > > I don't think you can implement pread/pwrite as section (3) routines; > the need for them arises from the need to pass a seek offset with > a read or write request because you can't trust the seek+read or > seek+write to be atomic -- so implementing them that way would > leave a race window open. > Actually, I was thinking about implementing them as aio_read/aio_write, with a aio_suspend and aio_error call. Those would likely have no such race conditions. (aio_read/aio_write are atomic.) > > I know that; it's just evil that the POSIX people have implemented > before thinking. SVR4 kernel threading was implemented without a > great deal of thinking (the SVR4 VM architect assured me that there > was VM support for dynamic per thread stacks, but that the SVR4 > threading implementation simply chose to ignore it in favor of > statically allocated stacks; similar cases abound). > Actually, I had thought about supporting dynamic per thread stacks, but nothing keeps us from doing that as an *extra*. The decision by POSIX was probably made as a compromise. > > I hate the fact that it's still possible to make a non-I/O based blocking > call (like, oh, wait3()) that doesn't result in a call conversion and > context switch: basically, you *must* give away your quantum that you > were promised by the scheduler in order to make this and similar > calls. What were they thinking? > Interesting thought. -- John dyson@freebsd.org jdyson@nc.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712021854.NAA02027>