May 20, 2019, 04:25:59 pm

News:

SMF - Just Installed!


Nrcomm and threads

Started by ELCouz, January 10, 2015, 11: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.