LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Shmuel Fomberg Date: Thu Aug 7 13:02:29 2008 Subject: Re: XS callbacks from different threads.
Josef Wolf wrote: >> Well, maybe, but there is already one thread that is passing through >> perl, so calling PERL_SET_CONTEXT for this perl on other thread is >> pulling the rug under the first thread's legs. it can't be good. > I've got it working now. The solution is to PERL_SET_CONTEXT() > _before_ declaring the context with dTHX. The code looks like this now: Interesting to know that it's working. Thanks. >>> static SV *callback_ref = (SV*)NULL; >> Reality check: you do know that "static" means here, right? > I think so: I have exactly one instance of this variable. Do you see > any problems with this? Um, you are thinking C++. declaring static variable outside object or function says something about it's scope. (you still get one instance of this, even without the static) >>> int call_perl (int cnt, ...) >>> { >>> dTHX; >>> PERL_SET_CONTEXT(my_perl); >> I hate the "my_perl" parameter. Who defined it? what is it set to? > AFAIK, this is created by dTHX. Correct. but from where does the dTHX take it? from the connection between the thread and one perl interpreter. who makes the connection? PERL_SET_CONTEXT. but the PERL_SET_CONTEXT is inited with my_perl... see the loop here? Shmuel.
| Navigate in group perl.ithreads at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |