[srslte-users] mutex in the sf_worker class

Xavier Arteaga xavier at softwareradiosystems.com
Fri Aug 30 07:53:16 UTC 2019


Hi,
The mutex is for protecting the sf_worker configuration from the RRC. The
RRC may configure the physical layer while the sf_worker is processing a
subframe. So, the mutex prevents the RRC thread from changing the physical
layer configuration of sf_worker while it is processing. Also, it protects
the sf_worker from processing a subframe while it is getting configured.

I hope this helps.

Regards,
Xavier


On Fri, 30 Aug 2019 at 08:40, Padorin Kurpinsky <padorin.kurpinsky at gmail.com>
wrote:

> Hi, Xavier.
>
> I'm trying to understand the role of mutex in sf_worker in srsUE code.
> There is a member variable *mutex* in the sf_worker class (i.e.,
> srsue/hdr/phy/sf_worker.h), and some functions in the sf_worker class are
> surrounded by mutex_lock() and mutex_unlock(), some are not.
>
> For example, sf_worker::set_tdd_config() does not have mutex_lock() and
> mutex_unlock(), sf_worker::work_imp() has mutex_lock() and mutex_unlock().
> Why do we need mutex in the sf_worker? Only one sf_worker can be allocated
> to the particular tti, so in the particular tti, only one sf_worker can
> execute the sf_worker::work_imp() which is surrounded by mutex_lock() and
> mutex_unlock(). It seems not necessary to me.. Can you elaborate on the
> role of this mutex? What scenario can cause the crash when the mutex is not
> used?
>
> Thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.srsran.com/pipermail/srsran-users/attachments/20190830/c919176c/attachment.htm>


More information about the srsran-users mailing list