There are two things here.
The two threads have to be synchronized. It can happen that you are writing to the vector at the exact same moment as the another thread is reading from it. If the writing has not completely finished you are reading back incomplete data that can cause an access violation.
ConcurrentCircularBuffer does the synchronization for you, or you can use a mutex. You can find some usage examples in the samples folder, like in the Kaleidoscope sample, which sends
Surface's back to the main thread in the
Creating textures won't work in an other thread if you don't share the context.