The way I understand it, the current BeginWrite on the FileStream object will 
write out it's buffer at the location of the last Seek.  The problem comes when 
there are multiple threads using the same FileStream instance.  Each one is 
looking to write to a different offset in the file.  This means each thread 
must call FileStream.Seek followed by FileStream.BeginWrite  Obviously, this 
creates a race condition.

Why isn't there an async BeginWrite, on the FileStream, with an argument which 
specifies the offset within the file to write to.  It's possible to call 
WriteFileEx within the Win32 API with an OVERLAPPED struct which specifies the 
offset.  Why isn't this exposed through the framework?


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to