| I am wondering if there is a way to find out whether we are in the main thread or not, and avoid the call that hangs.
On 27 Nov 2013, at 22:16, Francois PINOT wrote:
> Just read this: http://docs.python.org/2/c-api/init.html. I'm afraid you're right. So the conclusion is: do not use the callback process mechanism of CsoundPerformanceThread python wrapper along with the CsoundPerformanceThread.Join method. In that case use a time.Sleep() to wait for the end of the thread instead...
>
>
> 2013/11/27 Victor Lazzarini
> Actually, it is to do with the GIL.
> It hangs on
>
> PyGILState_STATE stat = PyGILState_Ensure();
>
> I think that bit of code makes the thread unjoinable. I am not sure right now if there is a solution apart
> from not allowing python function callbacks, which is a shame.
>
> On 27 Nov 2013, at 21:53, Victor Lazzarini wrote:
>
> > I don’t think the callback is running in a different thread, but I see that there is an issue. It might be to do with
> > the python GIL.
> >
> > This redefinition of the callback was written by me many years ago, to allow Python functions to be used as callbacks,
> > and it seemed to work, but I don’t think I have used Perf.Join() at any point before, so the problem might have been there
> > for a long time.
> >
> > Victor
> > On 27 Nov 2013, at 20:35, Francois PINOT wrote:
> >
> >> Hello devs,
> >>
> >> when modifying the end of csound6/examples/python/cb.py file like this:
> >>
> >> #time.sleep(30)
> >> perf.Join()
> >>
> >> and running the file, it hangs indefinitely. I looked into the csound6.interfaces/python_interface.i file, and I noted that the c++ SetProcessCallback method of the CsoundPerformanceThread class is ignored by swig and redefined in this file (lines 417-440). It seems that the redefinition of the method causes the callback to run in another thread than the CsoundPerformanceThread instance. This could explain the indefinite hanging of the program.
> >>
> >> I'm actually writing a Csound API wrapper for the google go language (https://github.com/fggp/go-csnd6). I've translated in the go language the first 10 python examples for the Csound API written by Steven (https://github.com/kunstmusik/csoundAPI_examples). I added example13.go in which I show how to use the callback convenience of CsoundPerformanceThread. When I tried to translate my example in python I had the above issue.
> >>
> >> Should I file a ticket?
> >>
> >> Regards
> >>
> >> Francois
> >> ------------------------------------------------------------------------------
> >> Rapidly troubleshoot problems before they affect your business. Most IT
> >> organizations don't have a clear picture of how application performance
> >> affects their revenue. With AppDynamics, you get 100% visibility into your
> >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk_______________________________________________
> >> Csound-devel mailing list
> >> Csound-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
> >
> > ------------------------------------------------------------------------------
> > Rapidly troubleshoot problems before they affect your business. Most IT
> > organizations don't have a clear picture of how application performance
> > affects their revenue. With AppDynamics, you get 100% visibility into your
> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |