I'm not sure whether I understand your question. Generally, EW created application is limited to run within one GUI task/thread only. In any case you should try to call EW functions from other threads. This will lead to fatal inpredicable errors.
If you have several tasks, you need a kind of interprocess communication. This can be a message queue or a system event. The second task uses this IPC service to send a message to the GUI task. The GUI task, in turn, receives the message and performs the associated operation in its own context. In the simplest case you can use a global C variable declared as volatile. The second task sets the variable and the GUI task evaluates it periodically.