I have an application with a main window. It has it's own thread and opengl context. This application also has one worker thread per processor to create and upload software rendered textures. This works perfectly well.
My worry is that the worker thread opengl contexts are created with the device_context of the main window. So in the case of a dual processor system, that means that 3 opengl contexts are bound to the same window device_context. They are all created in the main window thread, then sharelist is called to make them share textures, and then each of the gl_context is activated in only one thread, one for the main window thread, one for each worker thread.
As I wrote earlier, this works perfectly on all the machines I've tested it on but I've seen no documentation that describes what I am doing, and the only confirmation that what I'm doing is fine I've found is the last comment on this link: OpenGL multiple rendering contexts in one window .
So, I was hoping someone was aware of confirmation that this will work on all systems.
edit: I forgot to mention it earlier, but there is one issue, it is that if both worker threads are calling wglmakecurrent(common_window_device_context,private_opengl_context) simultanously, one of them will fail with glgeterror=GL_INVALID_OPERATION . The solution is in that case to call sleep(1) to allow time for the same call in other thread to finish and then call wglmakecurrent again and then everything works super smooth. At least on all machines I've tested.