IIS Worker Process and File Access

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
 
G

George Ter-Saakov

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.
 
G

Guest

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?
 
M

Matt MacDonald

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.
 
T

teddysnips

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top