Re: [libgpiod v2][PATCH v3 4/4] bindings: python: implement python bindings for libgpiod v2

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

 



On Wed, Oct 26, 2022 at 02:32:35PM +0200, Bartosz Golaszewski wrote:
> On Thu, Oct 13, 2022 at 5:10 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
> >
> > On Fri, Oct 07, 2022 at 04:55:21PM +0200, Bartosz Golaszewski wrote:
> 
> I agree that the C code should not crash - so it makes sense to not
> assign self->chip with GIL released. But for thread-safety in general
> - I don't think the module should care about it. Just like C and C++
> libs leave it to the user. The only thing we should care about is not
> keeping any global state that could cause problems in multithreaded
> apps.
> 

Yeah, agreed - no locking or thread safety guarantees - we don't want to
add the overhead of locking, and the user can provide their own locking
wrapper if they need it, probably at request scope.
As long we we don't go messing with Python objects outside the GIL, or
sharing state between requests (and we don't) then we should be fine.

Sorry for the confusion there on my part - I think I was flipping back
and forth between Python and Rust and carried some of my Rust Sync
concerns over to the Python.

Cheers,
Kent.



[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