[net2-wg] ActiveMessageC / SendPoolEntry

Philip Levis pal at cs.stanford.edu
Wed Nov 30 08:44:38 PST 2005


On Nov 30, 2005, at 3:10 AM, Omprakash Gnawali wrote:

>
> ActiveMessageC would be a wrapper around SendPoolEntry ?
>
>>
>> Thoughts? Again, this is kind of complicated, but it's the powerful
>> interface that performance-critical protocols can use.  
>> ActiveMessageC is
>> basically just a pool entry which never has futures.

Yes. Something like this, which is missing a lot of the details but  
hopefully get the general idea:

// Note that in 2.x, P is for Private components that you generally
// shouldn't wire to (think protected/private classes), while C is
// for Components that you can wire to
module ActiveMessageP {
   provides interface AMSend[am_type_t];
   provides interface Receive[am_type_t];
   uses interface SendPoolEntry;
}
implementation {
   bool busy = FALSE;

   command error_t AMSend.send(am_addr_t addr, message_t* msg,  
uint8_t len) {
     if (busy) {
       return EBUSY;
     }
     // Format the headers in here, then..
     busy = TRUE;
     call SendPoolEntry.setDestination(addr);
     call SendPoolEntry.setFutures(0);
     return call SendPoolEntry.start(msg);
   }


   event void SendPoolEntry.stopped(message_t* msg, error_t err) {
      busy = FALSE;
      signal AMSend.sendDone(msg, err);
   }

}

-------

"We shall not cease from exploration
And the end of all our exploring
Will be to arrive where we started
And know the place for the first time."

- T. S. Eliot,  'Little Gidding'





More information about the net2-wg mailing list