Eric,

I'm afraid your comment bdelow does not make much sense to me. Also I did not suggest any polling.

On Apr 19 2018, Eric Wing wrote:

On 4/19/18, Jörg F. Wittenberger <joerg.wittenber...@softeyes.net> wrote:
On Apr 19 2018, Eric Wing wrote:

Since there seems to be so much concern and speculation about the
size, complexity, and implementation of what the patch might look
like, I went ahead and implemented a fully working version for Windows
and GTK to provide something completely concrete to review.

I'm afraid there was little concern or speculation about size and complexity. The only concerns I read where calling into question whether or

not it was a good idea at all. Thus suggestions flowing your way how others

would solve or have solved the issue.


That is fair, up to a point. There was lengthy discussion on
PostMessage vs. PostThreadMessage and the consequences of such.


To respond to your previous post/solution...(the IupFlush
clarification), your solution actually could work. I could create an
IupTimer and externally poll. But this has a major downside in battery
consumption...and the higher the responsiveness, the worst the
consumption.

Modern native event loops are highly optimized to not do work when
nothing needs to be done. (Set a breakpoint after Windows GetMessage,
and it is fascinating how often it just sits there not moving.)
Polling though an external mechanism means burning cycles even when
not needed, which also means modern CPUs which have automatic
throttling can't usually do so in this scenario. This is why all the
platforms designed their own event-loops and intertwined their GUI
infrastructure with it, and why IUP had to abstract the native event
loops in the first place.

For the use cases I need, this unfortunately is not an acceptable
trade-off. And I think in general, there is no good reason to have to
make this trade-off. A cross-platform yet native solution is only a
handful lines of code because the native platforms intended to solve
this very problem already and expected you to use it. For the cases
where polling and burning CPU is acceptable, those are typically
games. There we are used to having non-native event loops... SDL is an
example of providing such a loop. But even SDL has the capability of
posting custom messages to its event queue to deal with these exact
same kinds of threading issues.


Thank you for the suggestion though. I understand you were sincerely
trying to solve my problem.

Thanks,
Eric

------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to