4 ms·
We no longer need locks in the core because there is now only 1 thread that interacts with the core. We still have other threads but all they do is schedule tas
by balloob 10y ago
We no longer need locks in the core because there is now only 1 thread that interacts with the core. We still have other threads but all they do is schedule tasks to be run on the event loop.
https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/core.py https://github.com/home-assistant/home-assistant/blob/dev/ho...
- takeda 10y agoThere's still a possibility that a lock might be needed if you use await/yield from inside critical section (another co-routine could make changes at that point). If you don't yield then indeed locks are not needed.