On Tue, 2004-05-11 at 10:45, Dan Sugalski wrote: > That'll still need some C. The event system as it stands is all > active--all event sources put events into the system, rather than > having the event system go looking at event sources for events. You'd > either need to queue up regular timer events to go check for new > stuff or have a thread actively polling the source for events and > throwing them into parrot's event queue.
The thread seems like the way to go, if I can enqueue an event without writing any C -- just post EventPMC from PASM? So for SDL, I'd start a separate thread that blocks on SDL_WaitEvent, creating and posting events when they happen. My main program would handle the events as normal Parrot events. Standard producer consumer stuff. Since it's blocking, it won't eat up too many resources -- that's nice. It'd be nice to have the SDL event thread ignore events I don't care about though, instead of creating event PMCs I'll just throw away later. Is this what you have in mind? -- c