Re: [PATCH V7 5/8] libgpiod: Add gpiosim rust crate

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

 



On 17-10-22, 21:00, Kent Gibson wrote:
> > +/// Sim Ctx
> > +#[derive(Debug)]
> > +struct SimCtx {
> > +    ctx: *mut gpiosim_ctx,
> > +}
> > +
> > +unsafe impl Send for SimCtx {}
> > +unsafe impl Sync for SimCtx {}
> > +
> 
> Is gpiosim thread safe?

There is no locking in place at the moment, if two threads try to do
conflicting operations at the same time. Nothing will stop them I
believe.

Though this module is only used for carrying out the tests at the
moment, where we are generating events from parallel threads. I am not
sure if we should make it more complex, for example with locking. Or
is there something else we can do ?

-- 
viresh



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux