Tango file i/o

Jason House jason.james.house at gmail.com
Wed Mar 19 10:20:52 PDT 2008


Lars Ivar Igesund Wrote:

> Jason House wrote:
> Yes, because your TempFile is a Conduit that provides both the input and
> output stream.

One of these days, I'll try to figure out all the layers of abstraction int he Tango I/O library...  Both what each piece means and why they (strange?) names were chosen.


> > The real test is
> > multi-threaded with reading and writing done asynchronously.  With
> > independent file classes, will EOF be a problem?  AKA, if a read occurs
> > when a write is in progress.
> 
> You should lock your resources (files) while writing.

What kind of locking mechanism are you talking about?  synchronized(obj)?  This would work to ensure proper behavior when reading from temporary file like in my unit test, but can't be done in a more general asynchronous case...  such as when using pipes for communication, or the console.



> 
> -- 
> Lars Ivar Igesund
> blog at http://larsivi.net
> DSource, #d.tango & #D: larsivi
> Dancing the Tango



More information about the Digitalmars-d-learn mailing list