Groups | Search | Server Info | Login | Register


Groups > comp.arch.embedded > #32161

A fileevent question

From Helmut Giese <hgiese@ratiosoft.com>
Newsgroups comp.arch.embedded
Subject A fileevent question
Date 2024-02-27 22:27 +0100
Organization ratiosoft
Message-ID <49jstilsf0a26l4s504gnbl5n9819ccdcb@4ax.com> (permalink)

Show all headers | View raw


Hello out there,
just asking for inspiration.
I have a simulation which executes commands - everything ok.
But now the program should also communicate with external hardware via
a serial connection and that is the problem:
- I don't want to block waiting for an answer since I also have a GUI.
- Turning to file events I now have the problem that the simulation
cannot continue before a particular call to the hardware is complete:
It may ask the hardware for a particular value which is to be used in
the next command.

So my question is: How do I block execution of the simulation part
until an answer arrives /without/ blocking the whole app?
- An attempt to use 'vwait' resulted in the whole app freezing.
- A separate thread would probably solve this problem.
- A coroutine would instinctively be a "lighter" solution but I have
so far never used coroutines and didn't find an example which seemed
to "fit" my situation.
- Any other way ...

Any idea, tip or link will be greatly appreciated
Helmut

Back to comp.arch.embedded | Previous | NextNext in thread | Find similar


Thread

A fileevent question Helmut Giese <hgiese@ratiosoft.com> - 2024-02-27 22:27 +0100
  Re: A fileevent question Helmut Giese <hgiese@ratiosoft.com> - 2024-02-27 22:30 +0100

csiph-web