Re: Async File IO is not async?

Stoyan Damov <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
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®  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.