Re: Threads






On Fri, Oct 18, 2013 at 11:04 PM, Craig Bakalian <craigbakalian verizon net> 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
 




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