I am parallelizing some of my code, and in this section, I have DataViews accessing a common DataTable. There are places where I modify the DataViews, but in necessarily discrete records among the threads. Do I still need to institute Semaphores for these modifications (not row addition/deletions, but only mods), if I know that specific records won’t be touched simultaneously?
Share
Well, I went ahead and tried implementing the solution as if that were true, and a
DataTableis very not thread-safe. e.g. Modifying one record and creating a new (unrelated)DataViewat the same time will result in an Exception. A good learning exercise, I suppose.