Parallel processing, part two: event driven ? (some thoughts)

From: lanas <lanas_at_securenet.net>
Date: Tue, 27 Sep 2005 17:13:44 -0400
To: prima_at_prima.eu.org

Hello Dmitry, hello all,

  I'm wondering which approach could fit best with Prima's loop, if there's
such a choice in the first place.

  Starting with Dmitry's recent example on parallel processing, let's assume
that several tasks are to be performed in sequence using this method. Of
course, once the Prima::File is created it runs asyncronously, returning
immediately to Prima's main loop (and any other things to do in there).
Which is very fine.

  Now, if several such tasks are to be performed in sequence, what approach
would you recommend ? As far as I can see there are the Prima::Timer which
looks like a crude approach but could nevertheless work I think, and there's
the Prima::EventHook about which I there are no examples in the Prima example
files.

  This is kind of to implement a state-driven application. The app is in a
state which is waiting for the outcome of the first parallel processing.
Then, if successful, it launches the second parallel processing task, and
waits for the outcome (while possibly output to a Prima::Edit box the stdout
of the task). So on so forth, ad vitam.

  The timer could 'poll' the state of a (shared ?) variable regularly, maybe
each 500 ms, depending on the task that's going on.

  But then the Prima::EventHook interface looks very interesting. Is it
possible to create our own events and is it possible to set them in one way
or another and expect the 'callback' (i.e. state manager) to immediately
react upon ? How does it work exactly, any examples around ?

Best regards,

Al
Received on Tue 27 Sep 2005 - 23:01:34 CEST

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:06 CET