gwsystems / composite

A component-based OS

Home Page:composite.seas.gwu.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Callbacks for AEP threads

phanikishoreg opened this issue · comments

AEP threads are those that have a rcvcap to wait on an event sent either by an interrupt or from other subsystem.
Typical code construction of an AEP thread is:

void
aep_fn(arcvcap rcv, void *data)
{
      while (1) {
            int pending = cos_rcv(rcv, ...);
 
            //do work
       }
}

This is very much required to be followed for correct working of receiving events. Instead of making this a requirement for user-level code, we could design the AEPs such a way that, on even arrival, we make call-backs to the user code and user is free to write the call backs however they'd like.
In the backend, we follow our cos_rcv calling conventions. This would require that the AEP creation change to use "call back function" and pass data along, which would be very much similar to the API we have now.