Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:4171] POLL_EVENTS problem solved!

Date2004-02-26 07:43
FromAnthony Kozar
Subject[CSOUND-DEV:4171] POLL_EVENTS problem solved!
I finally tracked down where POLL_EVENTS was being called too often.  In
version 4.22, the function kperf() in file insert.c contains these lines:

      while ((ip = ip->nxtact) != NULL) { /*   for each instr active */
#ifdef CWIN
        if (!POLL_EVENTS()) longjmp(cglob.exitjmp,1); /* PC GUI needs
                                                         attention */
#endif
        pds = (OPDS *)ip;
        while ((pds = pds->nxtp) != NULL) {
          (*pds->opadr)(pds); /*      run each opcode    */
        }
      }


In version 4.23, the #ifdef CWIN was removed for some reason.  This causes
POLL_EVENTS to be called tens of thousands of times during a short
performance instead of only a couple of hundred times.

On Mac OS 9, these extra calls are devastating to performance.  Adding the
#ifdef back improved rendering times by a factor of 10-80 for me.

In addition to fixing this problem, I have compiled 4.23f10 for Mac OS 9.
The same compilation problems that I noted for 4.23f07 are still present
(see post [CSOUND-DEV:3118]).  The #include "autoheader.h" statements in
every file are a problem now and it seems that the necessary gets.r file is
no longer in the source tarball like it used to be.

I will post detailed changes needed for compiling 4.23f10 on OS 9 tomorrow.
If I had developer status on Sourceforge, I could make the necessary
corrections myself.

Anthony Kozar
anthony.kozar@utoledo.edu