multithreading

20 views
Skip to first unread message

Toby Gifford

unread,
Jul 10, 2015, 2:51:57 AM7/10/15
to extemp...@googlegroups.com
So, multithreading in xtlang, can someone give me the potted summary?

I vaguely remember there being a DSPMT thingy, though I can't remember the details, and i'm not sure that it will do want i need.

I want a worker thread to asynchronously load an audio buffer, then thread-safely swap it over as the read buffer for my live DSP thread.

If I write a C-library with posix threads, are there any xtlang gotchas i should be aware of? Or can I do this with DSPMT (or some other way)?

Andrew Sorensen

unread,
Jul 12, 2015, 12:03:30 PM7/12/15
to extemp...@googlegroups.com
Hey Toby,

dspmt is not the way to go.  The dspmt stuff is for synchronous dsp code only - i.e. not async loading etc.. 

There are several ways you could go about the type of async loading you're after.  One would be to use an extempore process (ipc:new "tobyproc" 7091) ;; for example.  However, if you'd like to be a little closer to the metal then you can also spawn a native thread directly using the xthread library (libs/core/xthread.xtm).  There are a couple of very basic examples of usage in examples/core/xthread.xtm.

Give me a hoy, if you get stuck.

Cheers,
Andrew.



--
You received this message because you are subscribed to the Google Groups "Extempore" group.
To unsubscribe from this group and stop receiving emails from it, send an email to extemporelan...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Toby Gifford

unread,
Jul 27, 2015, 1:21:59 AM7/27/15
to extemp...@googlegroups.com
Thanks Andrew, i've got this working :)  Using xthread library.
Reply all
Reply to author
Forward
0 new messages