Sunday, January 20, 2019

Re: [Discuss-gnuradio] Gnuradio ring buffer code

Hi Ben,

>
> Could anyone help point me to the right part of the src, I've had an
> initial go but have been unable to find the specific parts of the
> code that handle the adding/taking of samples into the gnuradio ring
> buffer. I'm particularly interested to know what phtread scheduling
> is used if its different from the defaults and how mutexes are handled

Everything as fundamental as buffer setup can be found in
gnuradio-runtime/lib.
Specifically `buffer.cc` and `vmcircbuf.cc` contain code for setting ub
the circular buffer structure by mapping adjacent virtual memory to the
same physical memory.

Every block output port holds one of these buffers with read/write
pointers indicating the position of producers & consumers. Essentially
the access to these buffers is "lockfree" in the sense that the
producer is only allowed to write items up to the curent position of the
next read pointer and the consumers are only allowed to read up to
the current position of the write pointer.


Cheers
Andrej

No comments:

Post a Comment