Re: 1-wire behaviour on Bookworm

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: 1-wire behaviour on Bookworm
De : news (at) *nospam* druck.org.uk (druck)
Groupes : comp.sys.raspberry-pi
Date : 20. Sep 2024, 21:18:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vckla6$17vkc$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 20/09/2024 00:50, Lawrence D'Oliveiro wrote:
On Thu, 19 Sep 2024 10:36:16 +0100, druck wrote:

With the Pi 3B, I could either read the sensors sequentially taking
about 0.9s each, or using threads simultaneously in 1.0s. The Pi 4B with
Bookworm reads the sensors sequentially a shade faster at just over
0.8s, but when reading simultaneously, returns 2 after 0.8s, another 2
after 1.6s and the last two at 2.4s.

Is this Python code? Python threading cannot currently take full advantage
of multiple CPUs, owing to having to serialize all interpreter operations
through the “Global Interpreter Lock”.

It's a C program using posix threads.

I did initially write a Python version using the ThreadPool from
multiprocessing.dummy It is only milliseconds slower than the C as the
Python threads are able to yield when goes out to the system to read the
files in /sys/bus/w1/devices/

This is going to be fixed from 3.13 onwards.

That will be very useful for pure Python code. They are making things a
bit challenging by deprecating some other things before getting there,
which I'll need to sort out before moving on from 3.11.

---druck

Date Sujet#  Auteur
19 Sep 24 * 1-wire behaviour on Bookworm10druck
20 Sep 24 +* Re: 1-wire behaviour on Bookworm2Lawrence D'Oliveiro
20 Sep 24 i`- Re: 1-wire behaviour on Bookworm1druck
20 Sep 24 `* Re: 1-wire behaviour on Bookworm7John Aldridge
20 Sep 24  `* Re: 1-wire behaviour on Bookworm6druck
22 Sep 24   `* Re: 1-wire behaviour on Bookworm5John Aldridge
22 Sep 24    +* Re: 1-wire behaviour on Bookworm2Chris Elvidge
23 Sep 24    i`- Re: 1-wire behaviour on Bookworm1druck
23 Sep 24    `* Re: 1-wire behaviour on Bookworm2Lawrence D'Oliveiro
23 Sep 24     `- Re: 1-wire behaviour on Bookworm1Chris Townley

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal