Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

User-defined events?

6 views
Skip to first unread message

K Stol

unread,
Jul 29, 2003, 12:30:36 AM7/29/03
to perl6-i...@perl.org
Hello,

I've got a question concerning events.
As I read from previous discussions, an event is a message to the Parrot Interpreter saying something has happened: I/O jobs were finished, a timer went off, etc. These things are from 'outside' the system, that is something outside the interpreter gives a signal (such as a disk drive that generates an interrupt, indicating it finished disk IO). Except for the timer, I think, the timer will be some kind of built-in thing (right?).
(Ok, just a short explicit summary to check this)

Is it true that there will be operations for generating an event? So, unlike interrupt signals, these events are generated 'inside' the system. So, will there be an op like "postevent" or something?
How will this be done?

Klaas-Jan

Uri Guttman

unread,
Jul 28, 2003, 5:49:21 PM7/28/03
to K Stol, perl6-i...@perl.org
>>>>> "KS" == K Stol <k_s...@hotmail.com> writes:


KS> Is it true that there will be operations for generating an event?
KS> So, unlike interrupt signals, these events are generated 'inside'
KS> the system. So, will there be an op like "postevent" or something?

i expect it will be supported. all full event systems have what i call a
plain or user level event. there may even be priority levels. this is
very easy to do. dan has said that at critical times all high priority
events (async i/o, timers, etc) will be flushed from the pending
queue. when a special op is called (inserted by compilers), lower level
events can be processed and flushed from the queue. those would include
user events. i would expect the priorities would be simply to just flush
higher ones and then lower ones. how many levels is undecided but only a
few should be needed.

enqueuing a user event should be simple. you need to pass in some event
id or private data (an object pmc? code ref?) for the callback. this op
code allocates an event queue thingy, stuffs it with the provided user
data (and priority level) and enqueues it . it will eventually get
triggered/callback'ed when that queue gets flushed by the special op
code.

uri

--
Uri Guttman ------ u...@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org

0 new messages