discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Thread-Safe Blocking?


From: Robert McGwier
Subject: Re: [Discuss-gnuradio] Thread-Safe Blocking?
Date: Sat, 17 Dec 2005 10:28:26 -0500
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

I think the question was probably more than "what tools" but I could be wrong. Let me attempt more just in case.

gr-audio-osx should NEVER be blocked awaiting anything in gr. A sound system callback wants to feed and be fed and never get blocked. When it has new data, it should issue a semaphore release on the dsp/data processing system and the processing system should guarantee that it has data waiting BEFORE this callback is fired. Should these fail, error handling needs to be introduced. I use ring buffers for message or data passing. If I use ring buffers for message passing, the messages tell what member of the buffer pool is full of data for my use. This saves one level of data copying. There is no choice but to copy data coming to/from the sound system since that typically hands you a member of its buffer pool which you will lose access to immediately upon return from the call back.

Did any of this help at all?
Bob


Eric Blossom wrote:

On Tue, Dec 13, 2005 at 03:19:34PM -0500, Michael Dickens wrote:
In implementing gr-audio-osx, I've figured out (after much debugging) that 2 threads are conflicting (GR is 1 thread, CoreAudio is the other), and thus I need a semaphore or equivalent ... needs to be thread-safe. Does GR have a preference of what to use for this? Or is it OS- and programmer-dependent? Thanks! - MLD

ps> gr-audio-osx -almost- works, excepting this one issue (as far as I have found). Once that's resolved, I'll do some internal testing at UND over the holidays to flush out any other issues. Look for a release sometime in early January.

We use the omnithread abstraction.  This gives us a C++ friendly
interface to Posix (and NT) threads.  See
gnuradio-core/doc/other/omnithread.pdf

Eric





_______________________________________________
Discuss-gnuradio mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



--
Laziness is the number one inspiration for ingenuity.  Guilty as charged!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]