thread safety - File IO within an ASP.NET MVC Action -


is possible use kind of 'critical section' safe following within action...

public actionresult generatetasks() {     string somedir = ....      if (!directory.exists(somedir))     {         directory.createdirectory(somedir);     }      ... } 

you can using system-wide mutex. process or app-domain locking primitives fail work under conditions (for instance when application pool recycled).

however, specific case here that's not necessary: directory.createdirectory implement existence check on own, shouldn't need in regard.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -