[Jack-Devel] ringbuffer problems

PrevNext  Index
DateThu, 28 Apr 2011 15:28:27 +1000
From Timothy Godfrey <[hidden] at gmail dot com>
To[hidden] at lists dot jackaudio dot org
Follow-UpArnold Krille Re: [Jack-Devel] ringbuffer problems
Hello!

I am trying to use the jack_ringbuffer_t in an application for the
final year project of my bachelor of engineering, and I have run into
some trouble. Please let me know if this is not the right place to ask
my question.

The jack_ringbuffer_t documentation says

"The key attribute of a ringbuffer is that it can be safely accessed
by two threads simultaneously -- one reading from the buffer and the
other writing to it -- without using any synchronization or mutual
exclusion primitives. For this to work correctly, there can only be a
single reader and a single writer thread. Their identities cannot be
interchanged. "

What are the specifics of these conditions? I am writing to the
ringbuffer in the process() callback of my application, and I am
reading from the ringbuffer in the main loop. Does this count as being
in different threads?

For testing/education purposes, does it work to read and write to the
ringbuffer from within a single thread (to check that data went in
correctly, for example), without any other threads involved? Would
constitute a violation of the rule, 'Their identities cannot be
interchanged'?

Will I run into trouble if I am mixing a c++ (jack2?) application with
a jack1 server?

Many thanks,
Tim
PrevNext  Index

1303968532.19331_0.ltw:2,a <BANLkTi=tO15XtjEZCFzmeCRSSQc5O65C_A at mail dot gmail dot com>