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

Mark Wieder mwieder at ahsoftware.net
Fri Jul 23 15:34:33 EDT 2010


Andre-

Friday, July 23, 2010, 12:17:47 PM, you wrote:

> 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 Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list