Author Topic: Asynchronous messaging  (Read 298 times)

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3071
  • Karma: 1000
    • Wireless Communication Libraries
Asynchronous messaging
« on: June 24, 2018, 10:16:39 PM »
Asynchronous messaging

By default Wireless Communication Library(Bluetooth, IrDA, Serial and WiFi Frameworks) (WCL) uses Windows messages for inter-threading synchronization. Such synchronization requires that your application has message loop. It is good for WinForms (or other classic desktop) applications because all WCL events are always synchronized with the main application thread. But such synchronization may cause a problem in console or service applications.

WCL already includes one solution: wclThread class. The class allows to move all work with WCL into separate thread that implements message loop for default inter-threading synchronization. However it brings more complex coding for your applications.

The new Asynchronous Message subsystem does not require message loop and WCL can be used in console or service (or in threads) without any special coding. However with such synchronization method the WCL events may be called (fired) from any thread (not from only main applications thread). We call it "free threads" because there is no warranty which thread is used to fire an event.


Sitemap 1 2 3 4 5 6 7 8 9