i in vb.net , have function accessed multiple threads. inside function uses local variables. however, each thread pass in own dataset reference.
from have read local variables should no problem, think dataset coming in concern.
how should control access / execution of function make sure thread safe? thanks.
assuming 'dataset' mean system.data.dataset, if function reading dataset, don't need synchronization in case since "this type safe multithreaded read operations" (from http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx).
if you're modifying dataset, long each dataset different instance, there should no problem.
if you're modifying data , if different threads might pass in reference same dataset, you'll need synchronize access dataset using monitor (synclock or lock in c#) or other synchronization technique.
Comments
Post a Comment