Problems with Threads
superfix
superfix at bol.com.br
Tue Aug 7 16:31:03 EDT 2001
Hello guys. 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