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
Post a Comment