Re: Files not writing, closing files, finalize()
- From: Joshua Cranmer <Pidgeot18@xxxxxxxxxxxxxxx>
- Date: Mon, 17 Nov 2008 07:40:51 -0500
J. Davidson wrote:
Anyone want to know why there's [b]two[/b] layers of buffering in Java?
This is not phpBB. This is Usenet, which is generally pure text. The standard way of indicating boldness in pure text is with *a pair of asterisks.*
It's not that Java doesn't trust the OS buffering. It's because each trip through JNI to call an OS API routine is expensive.
I'm not an expert as to where the buffering is, but I'm pretty sure the call to the OS-level write routines are expensive in and of themselves.
Another fifty years from now we'll probably have a big teetering tower of abstractions and I/O will get buffered at six or seven layers instead of just two.
So? There's already high-level API buffering, filesystem buffering, and probably disk-level buffering as well. As long as they can be reasonably guarded against concurrency issues, there's no problem.
Wait, make that three. I think most modern disk controllers do some buffering of their own, because waiting for the right spot on a platter to rotate under the write head is expensive, and waiting for the head to move to a different cylinder is even more expensive.
- jenny
--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.
- Follow-Ups:
- Re: Files not writing, closing files, finalize()
- From: J. Davidson
- Re: Files not writing, closing files, finalize()
- From: Lew
- Re: Files not writing, closing files, finalize()
- References:
- Files not writing, closing files, finalize()
- From: Matt
- Re: Files not writing, closing files, finalize()
- From: Joshua Cranmer
- Re: Files not writing, closing files, finalize()
- From: J. Davidson
- Files not writing, closing files, finalize()
- Prev by Date: Re: Operator overloading [was Re: 7.0 wishlist?]
- Next by Date: Re: Request for profiler recommendation
- Previous by thread: Re: Files not writing, closing files, finalize()
- Next by thread: Re: Files not writing, closing files, finalize()
- Index(es):
Relevant Pages
|