Re: Threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/18/2013 11:12 PM, Paul Davis wrote:

On Fri, Oct 18, 2013 at 11:04 PM, Craig Bakalian <craigbakalian@xxxxxxxxxxx> wrote:
Hi Paul,

Okay, I have a design flaw.  I am the only one who uses this app, so no harm done.  But I am still confused by the conversation here.  If I cannot use gdk_threads_idle_add()  then what can I do. 

I am confused because, I imagine, anticipate that creating a thread in the jack callback and running it calling an function that inserts text into a textbuffer will not work because I can only act on the main thread?

A simple code example of a solution would be helpful.

all GTK GUIs should be unithreaded anyway.

from the JACK callback, queue whatever data you want in to jack_ringbuffer_t (which is a single-reader, single-writer lock free object), then use a semaphore to signal some other thread. easier than a semaphore, but not quite as RT safe: write to a pipe. the GUI thread can add the other end of the pipe to its event loop so that it will wake up when writing is done.

--p
 

Hi,

Is there a code example that does what you are saying?  Forgive me, I still don't understand what you are saying.  Are you telling me to write data to a pipe in the JACK callback?  If so, how do I get the pipe to send data to a GtkTextBuffer?

Craig Bakalian

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux