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
CAN_Read, CAN_Write in multithreading, are these reentrant?
-
- Posts: 8
- Joined: Fri 10. Sep 2021, 11:00
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: CAN_Read, CAN_Write in multithreading, are these reentrant?
All API calls are thread safe, so yes, you could call from different threads the same function.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
-
- Posts: 8
- Joined: Fri 10. Sep 2021, 11:00
Re: CAN_Read, CAN_Write in multithreading, are these reentrant?
Thank You very much for the fast and accurate answer.