• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
March 29, 2024, 07:37:30 am

News:

SMF - Just Installed!


Nrcomm and threads

Started by ELCouz, January 10, 2015, 10:09:50 pm

Previous topic - Next topic

ELCouz

Hi,

Is nrcomm a thread-safe vcl?

Example:

Can I call the function sendchar from a running thread without synchronizing (synchronise) with the main thread?

And should I use UseMainThread in this case ?

Thank you!

Roman Novgorodov

Hello

Yes you can call SendXxx() methods from any threads.

If you set UseMainThread in true, TnrComm calls its events (OnAfterReceive etc.), processes related controls and DataProcessor components from main app thread (main form message thread). It is necessary for correct work with visual controls.

If you set UseMainThread in false, TnrComm will call all related controls and events from its internal data monitor loop thread.

Roman Novgorodov
DeepSoftware llc
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.