I have a MFC project that uses Document-View framework. In my document code, I communicate with a networked camera, and acquire image frames in real time, and I display the images in my View class.
Is it possible to parallelize the works of document and View, such that Document updates my data model in real time, and View draws based on my data model in parallel while the document thread is doing its job?
I understand that I will have to synchronize access to shared resources between Document and View, but I think that only requires some diligent use of mutices.
The document and view must call each other so they cannot be in different threads. But you can certainly put your camera I/O code in a separate thread and use PostMessage to notify the main thread when a new picture is available.