Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7804887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:03:37+00:00 2026-06-02T02:03:37+00:00

Just a general question, I’m developing an ASP.NET MVC 3 web application that reads

  • 0

Just a general question, I’m developing an ASP.NET MVC 3 web application that reads from a configuration file using the Stream Reader inside a Using statement for automatic disposal as follows:

using (StreamReader sr = new StreamReader(filepath))
{

}

My concern is that when multiple users are running the application, a deadlock will occur when multiple instances of the application are reading values from the configuration file. My question is, are deadlocks an issue when working with the Stream Reader class? Intuitively I would think not, since I’m assuming the Stream Reader is opening the file in read-only mode and there are no external processes writing to the configuration file other than manual edits. I just wanted to be sure whether or not this would be an issue. Any insight is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:03:39+00:00Added an answer on June 2, 2026 at 2:03 am

    My concern is that when multiple users are running the application, a
    deadlock will occur when multiple instances of the application are
    reading values from the configuration file

    No, don’t worry. No deadlock will occur. You are opening the file for reading. So you could have concurrent readers. But if you write to this file in some other location of your code that you will get an exception. But no deadlock. If you want to properly synchronize readers and writers to some shared resource such as a file you could use the ReaderWriterLockSlim class. If you never write to the file (from the same process or some other process) then you are fine. But if you never write to the file, to avoid reading and parsing this file everytime, you should only read it once and cache it in some memory structure. For example that’s how the .NET application configuration system works. It reads and parses the app/web.config once when running the application and then stores it into memory for faster access. But of course everything will depend on your exact scenario.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For desktop application that is. This is just a general question that maybe only
i just create reading file feature. In general, what kind PHP class that usually
just a general question are there any issues with using named pipes from a
This is a very general question that is mostly just conceptual. I was thinking
It's likely that this is just a general Python Tkinter question, not necessarily a
(This was meant to be a general hypothetical question, me whining that .NET was
just a general design question that I'd like to hear some of your opinions
This is just kind of general question, steming from something else. Say you want
This is a general question that just popped into my head that I have
a bit new to programming and had a general question that I just thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.