From Helmut Giese@hgiese@ratiosoft.com to comp.arch.embedded on Tue Feb 27 22:27:39 2024
From Newsgroup: comp.arch.embedded
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
--- Synchronet 3.21d-Linux NewsLink 1.2
From Helmut Giese@hgiese@ratiosoft.com to comp.arch.embedded on Tue Feb 27 22:30:15 2024
From Newsgroup: comp.arch.embedded
Sorry,
wrong news group.
Helmut
--- Synchronet 3.21d-Linux NewsLink 1.2
Who's Online
Recent Visitors
Jas Hud
Mon Nov 16 00:41:01 2026
from
Bbs.Eob-Bbs.Com,wi
via
Telnet
Geek2
Sun Nov 15 09:22:57 2026
from
Euclid, Oh
via
Telnet
Amr
Fri Nov 13 16:10:06 2026
from
Fayetteville, Nc
via
Telnet
Geek2
Fri Nov 13 13:11:13 2026
from
Euclid, Oh
via
Telnet