[HELP!] Rev Externals: running a loop without disrupting the stack or inter thread communication

Andre Garzia andre at andregarzia.com
Fri Jul 23 15:36:43 EDT 2010


>
> > Second question and this probably shows my lack of deep C and Rev
> Externals
> > knowledge is, how can we start some "eternal" looping code in the
> external.
> > If you think about the question above, it is clear that something in the
> > main thread needs to be tied to the other end of the pipe or message
> queue.
> > This other piece of code might be blocked with select() or poll() waiting
> > for something to happen, now, if I create an externalCommand like
> > "webserver_initloop" that starts this loop, wouldn't it block the engine
> if
> > the function never returns? If this is confusing let me summarize: How
> can
> > some code on the external keep processing while returning the control to
> rev
> > at the same time.
>
> I've done that in an external by writing a complete event-handler loop
> as if the external were an application. You can then write your own
> event types and catch them in the event loop. It's weird, but it does
> the trick.
>
>
Mark,

But how to you start your event loop? If you start it by calling an
externalcommand from rev, does it block rev?

Thanks for the answer, this will really help me since there's only a single
event!

:D



-- 
http://www.andregarzia.com All We Do Is Code.



More information about the use-livecode mailing list