[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] running the interpreter from my own thread on the C side




On Dec 21, 2004, at 3:45 AM, ccos wrote:

this seems to work fine, haven't had a problem with it yet, but is it kosher, i.e. will it screw things up somehow?

void
* glSchedThreadFunc( void * data ) {

VMGlobals * g = gMainVMGlobals;


This object better be stored in a safe place in SC like a classvar to ensure that it cannot be garbage collected.

PyrObject * w = (PyrObject*)data; // this is an instance of sc class GLWindow


...


true) {


pthread_mutex_lock(&gLangMutex);


...

I hope there is a sleep or a wait for some event here.


++g->sp; SetObject( g->sp, w );
runInterpreter(g, s_prRender, 1);


pthread_mutex_unlock(&gLangMutex);



or here.

...
}
...
}

thanks,
_c
_______________________________________________
sc-dev mailing list
sc-dev@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev