views:

11

answers:

1

ASp.NET application. In button click i am accessing one text file and reading content and storing in other destination.

while both users clicking this button at a time deadlock(thread is being used by other process) will occurs so how to handle this i want to read each user one by one can any one suggest method to handle. i am looking to handle with waithandle events so can any one give a code sample for above scenario.

+1  A: 

You could use a ReaderWriterLockSlim to synchronize access to a shared resource such as a file.

Darin Dimitrov
thanks,Any example