I want to access I2C functionality from multiple tasks. My current plan is to have one task communicate with the I2C driver (the handler task) and pass the i2c_cmd_handle_t s which are created by different tasks to the handler task. Once the handler is done it should free the i2c_cmd_handle_t s.
So my question is:
Can one task malloc something and another task free that allocated memory?
Do I have to protect malloc and free from being accessed by multiple tasks at the same time.
I read through https://docs.espressif.com/projects/esp ... alloc.html but it didn't answer my questions.
Malloc and free threadsafe?
Re: Malloc and free threadsafe?
This question was also asked on GitHub, and has been discussed there:
https://github.com/espressif/esp-idf/issues/3768
https://github.com/espressif/esp-idf/issues/3768
Re: Malloc and free threadsafe?
Hello,ESP_Angus wrote: ↑Fri Jul 12, 2019 5:37 amThis question was also asked on GitHub, and has been discussed there:
https://github.com/espressif/esp-idf/issues/3768
Here discussion about malloc and free threadsafe w.r.t. ISR and question is about to tasks.
So, I have also heard that malloc and free are not threadsafe for normal execution except ISR.
Would you please clarify from your end as well?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot] and 204 guests