On 7 Sep 2010, at 00:42, Kassen wrote:
Indeed. But we don't have to calculate a sample every sample; we only need to calculate a block every block; there is some leeway.
What are these blocks? I thought Chuck is running in one thread. It is though true that one could free the marker of the memory synchronously, and let a GC in a separate thread collect inasmuch it gets time for it.
These refer to the amount of samples that are send to the soundcard at a time, it's set by "--bufsize". This is universal to addressing soundcards and not related to threading as such. Because of the size of blocks we may have more than a samp to spare (per block) for tasks...
OK.
...like GC. Maybe we don't have that time in some cases but of course; at some point we will be asking the cpu for more than it can provided, no matter the way in which we ask.
GC ought to be wholly independent of the ChucK thread that syncs the music, since it is only about collecting unused memory. Suppose you have a collecting GC that runs nicely in the sense that it does not interrupt ChucK perfect timing. Then it could within that limitation collect whenever it gets some time from the system to do it in its own thread.