I am using GLFW to create my window and I am on OpenGL 4.5.
What is the most OS agnostic way (if possible) to create a second OpenGL context to share objects with the main thread for multithreading (i.e one context per thread).
I don't know whether this method is OS agnostic enough, but in my application I simply use another hidden window:
//'pWindow' is the main GL context here...
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
pGLctx[0] = glfwCreateWindow(sw, sh, "slave0", NULL, pWindow);
glfwMakeContextCurrent(pGLctx[0]); //... to make it current in calling thread...
And that works for me.
I have to say here that generally speaking rendering and multithreading (on CPU that is) can be a nightmare to handle, so it is crucial to be sure that one needs it at all.