Reputation: 155
I have a BackgroundWorker that includes read/writes to IsolatedStorage. Right before the worker is run, I read from IsolatedStorage. Do I have to worry about using a Mutex, or will the worker only start once the read is completed?
//read from IsolatedStorage here
bgw.RunWorkerAsync(); //includes read/writes to IsolatedStorage
Upvotes: 0
Views: 75
Reputation: 29792
There are few things you have to consider:
bgw.RunWorkerAsync();
is run synchronous,bgw
is going to be only Task/Thread/Proccess using IsolatedStorage (check all events, methods, constructors... - also IsolatedStorageSettings, other methods eg. SaveJpg,then there will be no problem and you can do it without Mutex. But IMO it will be much safer/better to use one - here in the answer you have a good pattern.
Upvotes: 1