I am new to c++ network programming.
I have the case that there is web server connected to the application gateway through VPN. In the web server, I have the c++ scripts as below. I want to create multiple sessions and one session per thread and share some variables among these sessions. What the code should be then?

Code:
void APITest()
{

/* some global variables declared here*/

/* Start Thread 1 * /
                  /* Start Session 1 and call function which manipulate some global  variables * /
/* Start Thread 2 * /
                  /* Start Session 2 and call function which handle some global variables * /
}