[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] GEM mainloop and time consuming tasks



Hello,

Am Sonntag, den 27.01.2013, 23:34 +0100 schrieb Miro Kropáček <miro.kropacek@gmail.com>:

I know there's a lot of GEM wizards out there, so I'd like to ask this
slightly off topic question. How is programmer supposed to fight with
heavy operations like loading and analyzing hundreds of files? From Qt
and .net I'm used to the UI thread, events, signals but what about
the poor Atari world? Is there a way how to not freeze all dialogs? I
mean except the obvious things like calling refresh from the other
loop after each iteration or calling each iteration from the
UI mainloop.

What's wrong with calling evnt_multi_fast(...) every 100kb or every 1MB or whatever you need? You could also implement an progress callback in your analysing routine - this
way you would keep it independent from GEM.

Also the option of starting another process for the analysis of the hunk of files sound ok to me. Then you send some signals to you process via whatever mechanism you
like (unix signals or AES messages...) every now and then.

Both thing's doesn't sound to complicated to me, altough I never tried the last
possibility. Would be interesting to hear about results...

I really don't see a big problem here - except busy polling on a network socket - but you didn't mention that. (evnt_multi_fast should also allow and FD_SET parameter to watch for socket events...)

Can you explain why you don't like the idea of an progress callback or
something like that?

Greets,
Ole