Arthur Bergman <[EMAIL PROTECTED]> wrote:

> On 16 Mar 2004, at 06:36, Leopold Toetsch wrote:

>>
>> This is a snipped from the stress example program I posted some days
>> ago
>> with an additional check if events are to be handled.  Both functions
>> might not be in the extension interface[1].
>>

> Would it be possible to have a global variable that indicates if I have
> to poll for events, calling a function in-between every perl opcode is
> going to be very slow.

No global. The events are interpreter (or thread) specific e.g. for
timer events. The CHECK_EVENTS()/Parrot_do_check_events() used to be a
macro not too long ago, but anyway its basically

 if (interpreter->task_queue->head)
   ...

But you don't have to call it after each Perl5 opcode probably. Parrot
does check or will check (for certain run-loops) at scope exits, on
function calls and on backward branches (to handle loops).

>> [1] BTW: Why does Ponie use the rather limited extension interface?

> Because Dan said so, and because doing an include parrot.h in perl
> leads to one million or so cpp and gcc errors.

Can't you include parrot.h in one file that takes (a limited amount) of
Parrot guts. This file could be empty again, when the extension interface
really has all needed bits?

> Arthur

leo

Reply via email to