discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Recent development activity, upcoming plans


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Recent development activity, upcoming plans
Date: Thu, 5 Apr 2012 10:08:54 -0400

On Mon, Apr 2, 2012 at 11:10 PM, Josh Blum <address@hidden> wrote:
>
>> I hope this clears up why the PMT read/write issue is a non-starter.
>> I'd rather see a bit of slowdown then segfaults :)
>>
>
> I'm not sure what segfaults you are referring to. But the thread safety
> issue is already a problem. Technically, tags/PMTs are one giant race
> condition if your downstream blocks do not follow the implicit contract.
> We should fix this.
>
> -Josh

Tags are PMTs and write-once, read-only objects. To change them, you
have to create a new tag. This is what's done for the sample number
value when going through rate change blocks. We instantiate a new PMT
with the new value. Since they are read-only and this is handled in
the block executor, there is no problem. Even if we change the PMT of
a tag for the number of samples, anyone holding a reference to the PMT
at the time will still have that PMT until it goes out of scope.

The only issue with thread safety are those PMTs that are read/write
(like vectors, and we don't use them in the tags), and we are going to
fix them. There's no need for a pmt_const class because all PMTs are
constant. We're not going to introduce more writable shared memory
objects between blocks to exacerbate the problem.

Tom



reply via email to

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