CAN_Read, CAN_Write in multithreading, are these reentrant?

The free CAN Software API (Application Programming Interface) for Windows®
Post Reply
fsolodovnik
Posts: 8
Joined: Fri 10. Sep 2021, 11:00

CAN_Read, CAN_Write in multithreading, are these reentrant?

Post by fsolodovnik » Fri 10. Sep 2021, 11:11

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

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

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

Post by PEAK-Support » Fri 10. Sep 2021, 13:19

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
-------------------------------

fsolodovnik
Posts: 8
Joined: Fri 10. Sep 2021, 11:00

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

Post by fsolodovnik » Fri 10. Sep 2021, 14:18

Thank You very much for the fast and accurate answer.

Post Reply