Author Topic: Nrcomm and threads  (Read 1555 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
Nrcomm and threads
« on: January 11, 2015, 12:09:50 am »

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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1024
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Nrcomm and threads
« Reply #1 on: January 11, 2015, 05:38:09 pm »

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.