June 01, 2020, 06:31:47 pm


SMF - Just Installed!

Nrcomm and threads

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

Previous topic - Next topic



Is nrcomm a thread-safe vcl?


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


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.