Jump to content
  • Advertisement
Sign in to follow this  
akjal

[.net] Multiple application accessing same file

This topic is 3691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I have a dll(say DLL1) which log the execution sequence into a text file dll1.txt . Two applications ,say APP1 and APP2 (running in the same machine) are using the DLL1 . The problem is, sometimes, therre is a chance that APP1 and APP2 access the DLL1 which in turn accesses the text file at the same time. This leads to a contention betweeen applications and applications halt. The code for Logging is thread safe within an application. That is, even if the a single application has got more than one threads, it will be managed. Any help will be greatly appreciated. Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Hi guys,

I solve the issue by using a concept called system level mutex include in System.Threading.Mutex class of .NET.


These are the some links helped me to solve this issue.

http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=605
http://msdn.microsoft.com/en-us/library/aa332344(VS.71).aspx


Thanks everybody
akjal

Share this post


Link to post
Share on other sites
Yeah I think mastering a Mutex is an invaluable skill to have especially considering most PC's now have multi-core processors.

I had no idea you could use them on a system level or with file sharing. Especially handy considering you can use them along with unmanaged code. Thanks for the links.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!