Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Flush behavior of baseic I/O class type
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Yamagata Yoriyuki <yoriyuki@m...>
Subject: Re: [Caml-list] Flush behavior of baseic I/O class type
From: David MENTRE <dmentre@linux-france.org>
Subject: Re: [Caml-list] Flush behavior of baseic I/O class type
Date: Sat, 16 Oct 2004 18:26:24 +0200

> Yamagata Yoriyuki <yoriyuki@mbg.ocn.ne.jp> writes:
> 
> >   1) Output as far as possible, and leave the rest.
> >   2) raise an exception
> >   3) undefined.
> 
> Or  4) call blocked until the whole buffer can be flushed.

It may be ok for non-blocking I/O, but it will cause "busy-waiting" ,
so perhaps a user does not like it.  Moreover, for example, if the
channel is actually a filter, and it needs more inputs to determine
the next output, then it will stuck forever.  (See the case of the
multibyte charcter code converter in the previous mail)

The easiest way (from the implementer's point of the view) would be
1), or 1') do the best effort to output, but nothing is guaranteed.
However I'm afraid that it will cause a subtle I/O bug.

--
Yamagata Yoriyuki

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners