Hi Tom,

Thanks for the clarification. I will be very careful, I promise :)

Miklos

On Mon, Feb 24, 2014 at 4:15 PM, Tom Rondeau <[email protected]> wrote:
> On Sat, Feb 22, 2014 at 1:49 PM, Miklos Maroti <[email protected]> 
> wrote:
>> Hi Guys,
>>
>> Does copying a large pmt vector involve copying the underlying memory
>> region or do they share a single copy (refcounted)? If the do share a
>> single memory area, then can one thread modify the data of the vector
>> and will it be visible to the other thread just like regular arrays?
>>
>> Miklos
>
> Miklos,
>
> PMTs are always managed as a shared pointer (refcounted using
> boost::intrusive_ptr). So yes, you have to be careful with thread
> safety. PMTs are designed to be read-only to avoid the thread safety
> issue (for instance, when adding a key:value pair to a dictionary, you
> actually return a new PMT dictionary). The vectors are the only (and
> don't ask me why...) PMT type that is directly writable. So yes, be
> careful about thread safety issues with this structure.
>
> Tom

_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to