Multi-threading made easy
Like many other multi-threaded classes in the .NET Framework, CommStudio uses a SynchronizeObject property to determine which thread is used to call your event handlers.
By default, all CommStudio events run in your main application thread and you don’t have to worry about threading violations or marshaling.
The built-in .NET SerialPort fires its DataAvailable and PinChanged events from a helper thread. This means that inside your event code you should only access thread-safe objects inside your application.
If you access Windows Forms controls without proper thread marshaling, you’ll get an InvalidOperationException. Too many developers have found out the hard way that improper thread marshalling can be one of the most problematic issues to debug.
