mirror of
https://github.com/esphome/esphome.git
synced 2026-09-16 01:28:39 +00:00
09fc3bb9f5b4d96a29b072383e3cf11582e29823
Replace the FreeRTOS xQueue (xQueueCreate/xQueueSend/xQueueReceive) used for WiFi event passing with a lock-free SPSC queue. This avoids the FreeRTOS kernel spinlock overhead on every loop iteration when checking for events — the common case is an empty queue. The LockFreeQueue::pop() fast path is just two atomic loads and a comparison, vs xQueueReceive which takes a spinlock, checks the queue, and releases the spinlock even when empty. WiFi events are rare (connect/disconnect/scan) so heap allocation for event data is retained — no EventPool needed unlike the BLE path which processes hundreds of events per second. This matches the lock-free pattern already used by esp32_ble.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
596 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
