618 views
in System Integration by
Does Embedded Wizard support multi-threading? Is it possible to access the generated code from several tasks?

1 Answer

0 votes
by

For complex computations it might be helpful to start separate threads instead of making everything in the GUI thread.

Nevertheless, the entire user interface application has to be executed in the context of one thread - the GUI thread. For other purposes (e.g. receiving data from a network, accessing some hardware drivers,...) you can create as many worker-threads as you need.

The Chora language doesn't provide ready-to-use multi-threading. However, you can start as many threads as you need, by using your operating system. The only aspect you should take in account is the communication between your worker threads and the GUI thread. We recommend to use IPC e.g. message queues to communicate between the worker and the GUI thread. The worker thread can send a message and the GUI thread can react to it and call an Embedded Wizard generated function.

Important note: Also the Garbage Collector has to be invoked from the GUI thread - never try to call EwReclaimMemory() from another thread. Otherwise, your UI application will behave unpredictable... 

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...