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

Re: [MiNT] Calling GEM from within a signal handler



> > Let the signal handler set a flag and poll that with AES timer events.
...
> Let me explain a little of what I am trying to achieve. I have a program
> which will do some lengthy processing, but I want the user interface to
> respond even while the lengthy process is taking place.

>From your description of the problem, I don't see why you shouldn't be able
to do as suggested above.

> The lengthy process needs to be able to communicate quickly with the user

'lengthy process' suggests to me that it won't be interested in
communication very often.

> interface, and I think polling with the GEM timer event would not be
> practical.

Do you really need communication significantly more often than a couple
of times per second or so? That shouldn't hurt anything.

> After all that, what I am trying to do amounts to interrupting a GEM
> application from a non-GEM program. Is there an alternative way of
> achieving what I want to do?

This was discussed on the XaAES mailing list long ago and I seem to recall
that we came up with something. Whatever it was, it won't work with any
of Atari's AESes, of course.

Anyway, even without MiNT you can do what I do in the last few MGIF betas.
All my time consuming tasks periodically call a function whose main
purpose is to update a 'progress bar'. Like all my dialogs etc nowadays,
the progress bar is in a window, which of course means that it has to
deal with redraw requests and such. Dealing with those messages is not
any different from dealing with normal mouse, keyboard, menu events and
such, though, so it was very easy to also make the rest of the user
interface available at the same time. Actually, some operations (such as 
displaying an image (which MGIF currently always does full screen), IIRC)
can be run right in the middle of a large computation.  :-)

-- 
  Chalmers University   | Why are these |  e-mail:   rand@cd.chalmers.se
     of Technology      |  .signatures  |            johan@rand.thn.htu.se
                        | so hard to do |  WWW/ftp:  rand.thn.htu.se
   Gothenburg, Sweden   |     well?     |            (MGIFv5, QLem, BAD MOOD)