Page 1 of 1

CAN_Read, CAN_Write in multithreading, are these reentrant?

Posted: Fri 10. Sep 2021, 11:11
by fsolodovnik
Dear PCAN team,
I am developing the CiA application where calls to CAN_Read bzw CAN_Write are done from multiple threads and so these might be interrleaved.
My question is :
Is it safe to execute two similtaneous calls to CAN_Write from 2 different threads (under Windows 10)?
Or shall I use guard (Mutex) to access CAN_Write from two different threads


Thank You in advance
Best regards, Fedor Solodovnik
Seleon GmBH

Re: CAN_Read, CAN_Write in multithreading, are these reentrant?

Posted: Fri 10. Sep 2021, 13:19
by PEAK-Support
All API calls are thread safe, so yes, you could call from different threads the same function.

Re: CAN_Read, CAN_Write in multithreading, are these reentrant?

Posted: Fri 10. Sep 2021, 14:18
by fsolodovnik
Thank You very much for the fast and accurate answer.