commaai / msgq

MSGQ: A lock free single producer multi consumer message queue
184 stars 251 forks source link

msgq: add early return to msgq_poll to avoid unnecessary sleep & check #615

Closed deanlee closed 1 month ago

deanlee commented 5 months ago

Improves the msgq_poll function by adding an early return if messages are ready or if the timeout is zero. This avoids unnecessary sleep & msg ready calls, enhancing performance and reducing overhead.