Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2004-10-16 (18:29)
From: Yamagata Yoriyuki <yoriyuki@m...>
Subject: Re: [Caml-list] Flush behavior of baseic I/O class type
From: David MENTRE <>
Subject: Re: [Caml-list] Flush behavior of baseic I/O class type
Date: Sat, 16 Oct 2004 18:26:24 +0200

> Yamagata Yoriyuki <> 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 Archives:
Bug reports: FAQ:
Beginner's list: