IIS Worker Process and File Access

  • Thread starter Thread starter Matt MacDonald
  • Start date Start date
M

Matt MacDonald

Hi all,
If this isn't the write forum for this question, I appologize, but
it's kind of a mix of ASP.NET and IIS. Anyway, my question is this.
If an ASP.NET site is writing to a file, does the file get written as
soon as the request is processed or once the IIS Worker Process queues
it up? For example:

Users 1, 2, and 3 all hit the page that called the file write at the
same time. Am I left to deal with a file access violation because
users 2 and 3 can't access the file while user 1 is writing to it, or
will all requests get written without incident because the worker
process has to write them all in sequence?

This is more of a precautionary question than a problem I'm having.
Of course, regardless of what's "supposed" to happen I'm still going
to handle any exceptions that arrise, but I figured I should find out
what the ruling is as well.

Thanks,
Matt
 
I am not sure what is the question.
That is how file system designed. It's not really supporting simultaneous
access.
Use MS SQL (or any other database) for that. Or come up with single
threaded "Writer" that will queue up requests to write to file (not really a
good solution).

George.
 
You could definitely end up with file access collisions since IIS is
multithreaded and there could indeed be 3 separate Page class instances all
attempting to write the file with the same name at the same time. Maybe time
to rethink our logic?
 
You could definitely end up with file access collisions since IIS is
multithreaded and there could indeed be 3 separate Page class instances all
attempting to write the file with the same name at the same time. Maybe time
to rethink our logic?
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com








- Show quoted text -

Well at this point we're still brainstorming. I figured that was
going to be the answer, but I didn't want to overthink it and invest
additional time and resources if IIS was already set up to prevent
this anyway. Thanks to all for the responses.
 
Well at this point we're still brainstorming. I figured that was
going to be the answer, but I didn't want to overthink it and invest
additional time and resources if IIS was already set up to prevent
this anyway. Thanks to all for the responses.- Hide quoted text -

Neat! This thread has, I think, solved one of my (many) problems.

Edward
 
Back
Top