esp32-ble2mqtt icon indicating copy to clipboard operation
esp32-ble2mqtt copied to clipboard

operation_queue concurrent access

Open kfishermail opened this issue 3 years ago • 3 comments

After looking at the code, it appears (to me?) that operation_queue is being accessed concurrently by two tasks, should this access be protected by some sort of access mechanism (i.e. semaphore)?

kfishermail avatar Apr 26 '21 07:04 kfishermail

Hey,

You're probably right. I've recently added one for the devices_list so one might be in order here as well. Another option is to use FreeRTOS's queue implementation (not sure why I didn't use it in the first place) which is probably* thread safe.

*I'd still verify that

Thanks!

shmuelzon avatar Apr 26 '21 08:04 shmuelzon

I have a few other bugs/suggestions for your code, are you interested in hearing them? If so, should I post them to public forum, or this private email?

On Mon, Apr 26, 2021 at 1:08 AM Assaf Inbal @.***> wrote:

Hey,

You're probably right. I've recently added one for the devices_list so one might be in order here as well. Another option is to use FreeRTOS's queue implementation (not sure why I didn't use it in the first place) which is probably* thread safe.

*I'd still verify that

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shmuelzon/esp32-ble2mqtt/issues/104#issuecomment-826609919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIRDRSMFEGPVO72LVUZY73TKUNO7ANCNFSM43SIKQCQ .

kfishermail avatar Apr 26 '21 20:04 kfishermail

are you interested in hearing them?

Of course I am! Anything you think might help this project. Publicly is fine, there aren't any secrets in the code. But, if it's not too much trouble, I would appreciate a separate issue for each so it would be easier to manage and fix one at a time.

shmuelzon avatar Apr 27 '21 04:04 shmuelzon