|
Not at this time. Csound is currently single-threaded in the rendering loop.
In theory, it would be possible to change the rendering loop code just slightly to make Csound multi-threaded. I believe this is possible because inside the duration of a kperiod, running instrument instances do not write to shared data except for the output buffer, and they do not read from shared data that changes during the kperiod (ffitch and Varga et al., correct me if I am wrong).
Therefore, Csound could keep a pool of threads, and each running instrument instance could take a thread out of the pool and mix audio output back into the output buffer (which would have to be protected by a mutex), then put the thread back in the pool when finished. The rendering loop would wait until a thread was available before giving it to another running instance.
As far as I can see, this would make sense only in a shared memory space. Therefore, either it would only be feasible in a single computer with multiple CPUs, or the Csound memory allocator would have to use a heap shared across the network, which would slow it down too much to be useful, I think. So I believe it would only really be feasible on a single multi-processing computer. But I expect such computers to become more common over the next few years, even as personal computers. Even 2 CPUs would be quite a bit faster, and 4 or 8 would give a tremendous speedup.
Even at this time, you could still use a grid computing toolkit to break a large rendering job up into pieces, if you can break your composition down into independent tracks or sections, and each piece could be rendered by a single instance of Csound running on a separate computer. A final phase would mix the piece into a single soundfile or audio stream. But this way each piece would have to be programmed separately -- I don't think it's worth it.
-----Original Message-----
From: gerald wenzel
Sent: Apr 20, 2005 9:55 AM
To: "Making electronic dance music with csound."
Subject: Re: Re: [CsndTek] beowulf clusters
>From: Michael Gogins
>Csound is single threaded without a GUI, double threaded with a GUI, but
>needs to coordinate events across threads. A GUI performance might benefit
>modestly from 2 cpus, but Csound could not beneft from more than 2 cpus.
Is there a way to make csound double threaded from the command line? I do a lot of csound programming on a linux box that doesn't have a window manager.
_______________________________________________
csoundtekno mailing list
csoundtekno-N4abDuUB7xo@public.gmane.org
Subscribe, unsubscribe, change mailing list options:
http://plot.bek.no/mailman/listinfo/csoundtekno
_______________________________________________
csoundtekno mailing list
csoundtekno-N4abDuUB7xo@public.gmane.org
Subscribe, unsubscribe, change mailing list options: |