Good Morning all! Some of you know I have started writing a fictional book. Last night I finished up completing the cast of characters the book will use (though I am sure there will be other changes) and thought how I will begin the book. Now if you know any literary agents please send them my way please! If you have enjoyed my writing up to this point. 🙂
Anyway, back to the real world…..We needed to prevent changes being made by other threads when enumerating through our collection. Basically this prevented the threads from making changes while enumerations were occurring. It uses the concept of SyncLock to prevent these changes from being made.
Make it a great day!
Private Sub TimerFired() – happens every 1 second
Dim x As Integer = 0
Do While x <> MyList.Count – 1
ODC = MyList(x)
… condition 1: AddToMyList(ODC)
… condition 2: RemoveFromMyList(x)
x = x + 1
Private Sub AddToMyList(var)
Private Sub RemoveFromMyList(index)