title: Starting multithread python code from c++
body: <p>I'd like to create a simple python webserver to expose some functionality of my c++ application.</p>
  
  <p>I've already embedded python and I'm able to call python code and call back c++ function for the interaction.</p>
  
  <p>My problem is to be able to make the webserver run without locking the application.</p>
  
  <p>Using a python thread for the webserver stop the server as soon the initialization is finished. How to give time to the python interpreter to go ahead with thread processing?</p>
  
  <hr>
  
  <p><em>old explanation</em></p>
  
  <p>If I create the webserver (for example with cherrypy) it's also easy to call c++ function from the browser... what's is missing it's that the c++ application is locked. My idea is to use a python thread, but from test is the python code to lock when until another python code is called (any python code).</p>
  
  <p>So my conclusion is that I need to give some time to the python interpreter in during events management of the c++ application (MFC application)</p>
  
  <p><em>It's a best practises doing this? Is there some API function for doing this?</em></p>
  
  <p>Other solution is to create a c++ thread and start the interpreter using <code>PyThread*</code> functions... but my worries here is that the <code>GIL</code> lock the GUI application.</p>
  
  <p><em>Again: what is the best practises for this kind of job?</em></p>