Never used poll before, but if you what to block system execution then I suggest you to do it in another thread.
IupTimer will not work if the main/step functions are not being called. If you could call pool function inside a loop with a short wait time, then inside that loop call IupLoopStep and the system will be responsive. Best, Scuri On Sat, Jul 25, 2015 at 5:54 AM, "Jörg F. Wittenberger" < joerg.wittenber...@softeyes.net> wrote: > Hi Antonio & all, > > these days I wrote, changed, rewrote, modified etc. an ugly piece of > code. A workaround for me not knowing how to integrate Iup with a > poll(2) based message loop. > > All I could come up with where variations of a busy loop. And thus I > ended up with two IupVal controls to trade responsiveness for CPU load. > > I'm seeing IupTimer as the "intended" thing to use here. Thus the > application is essentially only running in the timer callback. > > This is mostly ok. Except it is not. The problem is: the message loop > wants to sit in poll(). If it does not, then i/o is delayed until the > next check. > > Therefore the app feels sluggish, since it does not react to i/o in > time. (Except for very short timer periods.) > > Worse the situation becomes if there is a lot of fast, local i/o going > on; like when accessing a database. I've seen this timer becoming the > bottleneck. > > The alternative is to frequently call IupMainLoopStep. This too results > in an unacceptable high load. Also it seem not to really work from the > timer in all cases. > > > So what would be "the solution"? > > The best thing I could hope for would be if I could ask Iup for a file > descriptor to listen on. Whenever data is ready to read on this fd, I > would know that Iup wants to become active and I should call the stepper > until it eat up all this input. > > I guess this would not be all to hard to implement at the Iup side. > > But maybe there is a better solution I don't see? > > Thanks > > /Jörg > > > ------------------------------------------------------------------------------ > _______________________________________________ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users >
------------------------------------------------------------------------------
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users