Hi Erik,
there seem to be several options. Tie simplest one is that you'll call getEvent with some reasonable timeout in a loop and check some communication channel an update from the calculation thread.
Probably the correct way how to handle it involves three threads:
(1) The computation thread writes its updates to a channel of type Either Event ComputationUpdate using Right.
(2) Another thread calls getEvent repeatedly and writes received events to the channel using Left.
(3) A consuming thread (the one for Ncurses UI) consumes the channel and reacts both to computation updates and Ncurses events.
However, I'm not sure if Ncurses doesn't mind calling getEvent from a different thread than the one that updates UI.
For the communication channel, I'd probably use TQueue (or TBQueue, if there is a risk of writing values too fast).
Best regards,
Petr Pudlak