The Python interpreter runs to completion. It will not "unwind" and return to your loop.
It uses *real* threads, and blocks on one to cause a context switch to another ready-thread.
Well... more specifically, one thread grabs the global lock. Periodically, it releases it and re-acquires it. In that short time-frame when it doesn't hold the lock, another thread can wake up, grab it, and begin execution for a while.
Thank you for the info. So, I would be able to do something like : char *scripts[N]; // my n scripts for ( i=0; i<n; i++ ) { start_and_interpret_in_new_thread ( scripts[i] ); } So, can someone explain me how to write such a function start_and_interpret_in_new_thread (s) ? Some example code would be apreciated . Thank you, Marcelo K. EPFL - DI - LIG