On Apr 12, 2007, at 7:25 PM, Mehedi Bakht wrote:

Hi,

I am a bit confused about why and how the interface Pool should be used when using the interface Queue (TinyOS 2.x). Any comment/ explanation will be really appreciated.


The two are completely separate. It just happens to be that some use cases require that you use both of them.

A Queue gives you a fixed-length queue of type <t>. For example, a transmission queue is a Queue<message_t*>, that is, a queue of pointers to message buffers. You would instantiate it an 8-deep send queue as a QueueC(message_t*, 8).

A Pool is a fixed-size memory pool of type <t>. For example, a pool of message buffers is a Pool<message_t>, and you instantiate it with PoolC(message_t, 8).

It happens to be that packet forwarding layers need both of them: when you receive a packet, you need to allocate one to give back to the radio layer, and you also need to put the received packet into the send queue.

Phil

_______________________________________________
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to