Re: Threads
- From: Craig Bakalian <craigbakalian verizon net>
- To: Paul Davis <paul linuxaudiosystems com>
- Cc: "gtk-list gnome org" <gtk-list gnome org>
- Subject: Re: Threads
- Date: Sat, 19 Oct 2013 07:46:03 -0400
On 10/19/2013 07:11 AM, Paul Davis wrote:
There are dozens if not hundreds of "examples" of this - any JACK
client with a GUI.
But to get an idea of the basic idea, take a look in the JACK example
clients and/or tools. jack_capture would be a good place to start,
since it faces the problem of handing over incoming (audio) data to
another thread.
And no, you are not writing "the data" to a pipe from the JACK
callback. The key ideas are (a) to move the data to another thread you
need to use a lock-free data structure (b) if you need to wake the
other thread (i.e. because it doesn't simply wake up periodically and
use whatever new data you've delivered), you need to use the *most*
RT-safe method you can. There are no absolutely RT-safe methods. A
semaphore (on Linux anyway) is the best, writing a byte to a pipe is
the 2nd best.
You cannot make calls from the JACK callback that may block - you
cannot write to disk, read from disk, take locks, etc, etc.
This really should not be going to the gtk-list anymore. It has
roughly nothing to do with gtk and more or less everything to do with
JACK.
Hi Paul,
If it has nothing to do with JACK, then why on earth was it working
before the latest release of gtk in ubuntu 13.10? Why could I write
data out from the JACK callback with no issues before?? It has nothing
to do with the JACK callback and everything to do with the overly secure
removal of
gdk_threads_enter();
gdk_thread_leave();
My application was working perfectly until the removal of these
functions. Furthermore, once I remove the insert to the gtktextbuffer
from the callback, all is well. And, the error that pops up is that the
gtktextbuffer layout can't get a line number. This has nothing to do
with JACK and everything to do with threads in gtk.
What on earth should I expect anything more than "get this off this
list" from I guy whose first response on a HELP list is "Your design is
wrong". It is obvious to me you don't know what my JACK callback is
doing. And your pipe explanation is a real hack. I understand it now,
and it won't work. No matter what, the darn gtktextbuffer is only going
to take an insert from something inside gtk. Overly secure aint the words!
I re wrote my MAKE file to use gtk2, which works. I quick solution.
Next, I am moving to QT.
Craig Bakalian
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]