Re: Embedded Python - Blocking Python Function

2007-11-16 Thread andy
On Nov 15, 5:03 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 15 Nov 2007 16:18:45 -0300, <[EMAIL PROTECTED]> escribió: > > > On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: > >> On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > >> wrote: > > >> > Not forcibly - you need som

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread Gabriel Genellina
En Thu, 15 Nov 2007 16:18:45 -0300, <[EMAIL PROTECTED]> escribió: > On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: >> On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >> >> > Not forcibly - you need some cooperation from the Main function. Maybe >> > setting a global variable th

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread andy
On Nov 15, 9:43 am, [EMAIL PROTECTED] wrote: > On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > > Not forcibly - you need some cooperation from the Main function. Maybe > > setting a global variable that Main checks periodically. > > Thanks. I'll give that a try! > > Andy I

Re: Embedded Python - Blocking Python Function

2007-11-15 Thread andy
On Nov 14, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Not forcibly - you need some cooperation from the Main function. Maybe > setting a global variable that Main checks periodically. Thanks. I'll give that a try! Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedded Python - Blocking Python Function

2007-11-14 Thread Gabriel Genellina
En Wed, 14 Nov 2007 20:02:42 -0300, <[EMAIL PROTECTED]> escribió: > The problem is that the function "Main" in the Python script can take > up to 60 seconds to execute. How can I terminate this thread (and > therefore the Main function in python) cleanly from the primary thread > of my application

Embedded Python - Blocking Python Function

2007-11-14 Thread andy
I embed multiple interpreters. I create the interpreter and modules in the primary thread of my application: PyEval_AcquireLock(); thread = Py_NewInterpreter(); PyThreadState_Swap(thread); ...initialize modules, etc PyThreadState_Swap(maininterpreter); PyEval_ReleaseLock(); Then I create a