The UI update and SampleProcess calls are documented as performing on different threads. However, the sample modules in the developer kit don't provide any explicit synchronisation of variables for inter-thread communication.
On the one hand, that's great for performance. On the other hand, presumably it may lead to concurrency issues (particularly given that double/long are guaranteed to be updated atomically).
For example, if I want to display a near-realtime waveform buffer screen update based on sample input, is there any recommended good practice on how to write to the buffer (ProcessSample without blocking) and read the waveform (from the UI thread every N milliseconds - hence the need for a buffer rather than a single value)? The closest I could see was the Oscilloscope demo module, but that code doesn't explicitly synchronise the values between the threads (aka make sure that the buffer is guaranteed to be written to memory prior to the Gui thread picking it up).
... or is it that I am missing something fundamental in the Modules architecture?
Thread communication between ProcessSample/UI
-
- Posts: 49
- Joined: Sun Aug 25, 2019 10:26 am
Jump to
- Cherry Audio
- ↳ Voltage Modular
- ↳ Instruments
- ↳ Atomika Synthesizer
- ↳ Blue3 Organ
- ↳ Rhodes Chroma
- ↳ CA2600 Synthesizer
- ↳ CR-78 Drum Machine
- ↳ DCO-106 Polyphonic Synthesizer
- ↳ Dreamsynth
- ↳ Lowdown Bass Synthesizer
- ↳ Eight Voice Synthesizer
- ↳ Elka-X Synthesizer
- ↳ GX-80 Synthesizer
- ↳ Harmonia Synthesizer
- ↳ Memorymode Synthesizer
- ↳ Mercury-4 Synthesizer
- ↳ Mercury-6 Synthesizer
- ↳ Miniverse Synthesizer
- ↳ Novachord + Solovox Collection
- ↳ Octave Cat Synthesizer
- ↳ P-10 Synthesizer
- ↳ Polymode Synthesizer
- ↳ Pro Soloist Synthesizer
- ↳ PS-20 Synthesizer
- ↳ PS-3300 Synthesizer
- ↳ Quadra Synthesizer
- ↳ Sines Synthesizer
- ↳ Surrealistic MG-1 Plus Synthesizer
- ↳ Synthesizer Expander Module
- ↳ Wurlybird 140B Electric Piano
- ↳ Cherry Audio Preset Packs
- ↳ Instrument preset exchange
- ↳ Effects
- ↳ Galactic Reverb
- ↳ Rackmode Signal Processors
- ↳ Stardust 201 Tape Echo
- ↳ Modules
- ↳ Aarnville
- ↳ Adroit Synthesis
- ↳ Andrew Macaulay
- ↳ Benard
- ↳ Ben Davis
- ↳ borkman
- ↳ Centripidity
- ↳ Black Cloud Industries
- ↳ Cherry Audio
- ↳ Cherry Audio/MRB
- ↳ Collider Modular
- ↳ Cyberwerks Heavy Industries
- ↳ DMT Audio
- ↳ Dome Music Technologies
- ↳ Gargoyle
- ↳ Hamster Modular
- ↳ Haslo
- ↳ HetrickCV
- ↳ Hype Audio
- ↳ Insomniac Music
- ↳ JKphobic
- ↳ Knobstradamus
- ↳ M*4
- ↳ Martin Dennis
- ↳ Misfit Audio
- ↳ Monkey Business Audio
- ↳ MRB
- ↳ nekomatic
- ↳ Nick Hladek
- ↳ Nrgzr78
- ↳ Oliver Moebus
- ↳ Playertron
- ↳ P.moon
- ↳ PoohBear
- ↳ PSPaudioware.com
- ↳ R_Ware
- ↳ Request for Music
- ↳ SHARP Modular
- ↳ Sonic Lighthouse Studio
- ↳ Sonobiosis
- ↳ Vulpus Labs
- ↳ Vult
- ↳ Waverley Instruments
- ↳ weevil
- ↳ Module Designer
- ↳ Cherry Audio Store
- ↳ Sync
- ↳ Tips and Tricks
- ↳ Preset Exchange