Help me - thread again

phill superfix at bol.com.br
Wed Aug 8 20:04:10 CEST 2001


I have been some problems with threads in 
python/c. Let me try explanation this:
- I have an interface write in python for c
- In this interface I call a module write in c
- In this module I call glutmainloop, otherwise, 
the program enters in loop to refresh the opengl 
aplication.

So, I need to return to python interpreter. 
otherwise, I need to keep two aplications in my 
program: python window and
opengl window. Note: I need to keep the terminal active 
together opengl.

/*Api*/
include <module.c>
. . . . . . .
. . . . . . . . . . . . . . .
static PyObject *agg_CreatAgent(PyObject *self, 
PyObject *args)
{
int x;
if (!PyArg_ParseTuple(args, "i", &x)
return NULL;

Py_BEGIN_ALLOW_THREADS
open_function(x, "filename");
Py_END_ALLOW_THREADS

Py_INCREF(Py_None);
return Py_None;
}
. . . . . . . . . . . . . .
. . . . . . .

Effect. Python simply call the open_function and fall in 
loop. How I can return the control to the python and 
keep this thread active?
Any thoughts?

Phill.


 
__________________________________________________________________________
Acesso pelo menor preço do mercado! R$ 14,90 nos 3 primeiros meses! 
ASSINE AGORA! http://www.bol.com.br/acessobol/






More information about the Python-list mailing list