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

Re: [MiNT] Fpoll() in GEM programs



Hello Arnaud,


Selon arnaud.bercegeay@free.fr:
> SOLUTION 2 :
>
> Create a thread for select() stuff. The thread will have select() as main
> loop,
> and the main application will have evnt_multi() as main loop... but a dialog
> between the main application and the thread is needed (otherwise, the main
> application and the thread may be splitted in 2 independant programs).
> So, we just have to create a pipe (?) between the main process and
> the thread... and then we have to add a select() loop in the main application
> to manage this pipe. We're back at the starting point.

Is it impossible for the "select()" thread to simply send an AES message to the
"evnt_multi()" thread ? For example to ask it to update a progress bar, or
notify it that there was an error while processing.

On the opposite side, "evnt_multi()" thread could write to a pipe to send some
informations to the "select()" thread. For example : user clicked the "Abort"
button ; current processing should be aborted and thread closed.

I think this can be done thanks to your work on MT gemlib.


Of course, an alternative way that would avoid multi-threading could also handy.


Best regards,

Xavier