All calls to/from python are performed on one thread via a simple message queue (necessary because of the global interpreter lock).