I have a vector that is constantly being updated (about 5-20 times a second) with new information by a process that I wrote to gather the information. I want to write a loop that would be able to detect a change in the vector, and then read the information and do the appropriate analysis that I write for that event. However, I know that there are many issues that arise from multithreading like this, so I'm curious what the best ways to do something like this are.
The vector is stored in a public class and is being updated by a feed we get from a financial company (the information being updated is futures indices).