[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] OOT Decimation Module dropping data samples
From: |
Martin Braun |
Subject: |
Re: [Discuss-gnuradio] OOT Decimation Module dropping data samples |
Date: |
Thu, 27 Feb 2014 14:09:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 02/27/2014 02:06 AM, Michael Berman wrote:
> I have figured out what was happening for me. As I was deprecating the
> source code to put out publicly, I noticed something that looking at now
> was a glaring red flag. Inside my OOT, I was copying the GNURadio
> buffered data into a vector for computation on the large set of data. I
> knew that it was going to be large, and trying to save space on the
> stack, I made the local variable static. This, of course, made all
> instances of the object have the same local buffer in memory, and I
> truly did have a classic multi-threaded problem on my hands. In my
> case, Instead of dealing with the overhead needed to guard the common
> resource, I simply removed the static keyword and allowed the memory to
> allocated on the stack.
Hah, a classic case of premature optimization :)
Glad you figured it out.
Martin