Re: Async File IO is not async?

Ryan Heath <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
Huh, the second opening appeared to be in async mode although not
explicitly defined. (I guess the framework did it for me, I'll
reflector it later...)
I verified it with setting breakpoints in debug mode.
In Alex' example VS was waiting on the BeginWrite, in my example VS is
waiting on the evt.WaitOne.

// Ryan

On Jan 18, 2008 9:45 AM, Stoyan Damov <[email protected]> wrote:
> On Jan 18, 2008 10:19 AM, Ryan Heath <[email protected]> wrote:
> > Hi Alex,
> >
> > I have altered your example into this [2]
> > because the kb had this line [1] which made me wonder ;)
> >
> > // Ryan
> >
> ...
> >       using (FileStream file = File.Create("out.test", 0x1000,
> > FileOptions.Asynchronous))
> >       {
> >         file.Position = 512 * 1024 * 1024 - 1;
> >         file.WriteByte(0);
> >       }
> >
> >       using (FileStream file = File.Open("out.test",FileMode.Open,
> > FileAccess.Write))
> >      {
> ...
>
> ^^^ 2nd ctor doesn't open the file in async mode. Also, I did the same
> thing, opened it async, opened it with 2 different async-enabling
> ctors, verified fiel.IsAsync == true and still the entire write goes
> as 1 synchronous call, wtf?
>
> Cheers
>
> ===================================
> This list is hosted by DevelopMentor(R)  http://www.develop.com
>
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.