[CM] Seeking suggestions for thread safe buffering into s7
Iain Duncan
iainduncanlists at gmail.com
Sun Mar 9 13:32:29 PDT 2025
Hi Bill and colleagues, so further to the spectral-processing-in-Scheme
project...
To do this, I'm building a scaled down Scheme for Max version that runs in
the audio thread. Max normally has two to three threads, messages happen in
the high or low priority message threads, audio in the DSP thread. In my
normal s4m objects, they only run in one thread. I need to be able to get
blocks of scheme code to the DSP thread for evaluation. I have various
resources on this kind of thing, but most are for C++. Max does have its
own in house thread library, though rather thinly documented.
Before I start rooting around trying potentially dumb things, I thought I'd
ask here to see how others would solve this problem. I have C code that
receives string messages, and I what I think I want to be able to do is
have the DSP-thread code (where the interpreter is) run on every sample
block, check a queue for incoming messages, receive them and eval (or some
number), and potentially send message back to the other thread. I am fine
with there being a single consumer and single producer (as in, each s4m
instance will have it's own interpreter that has to deal with at most one
dsp rendering routine. The message could potentially be large (ie whole
files of code).
Suggestions on the right approach to do this would be most appreciated.
thanks!
iain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20250309/04b3c3d9/attachment.html>
More information about the Cmdist
mailing list