On Jan 24, 2008 5:05 AM, Nue Noi <[EMAIL PROTECTED]> wrote: > Hi, > > I don't really get the idea of using get() and put() function offered by the > Pool interface. > For example, if I want to put something to the Pool without calling get() at > the first place, > put() will return FAIL. In init(), free is defined as "size". Does this mean > the initial state > the Pool is full, right?
Yes. > Otherwise, if free==0, Pool is empty, meaning that > I can "put()" Yes. But you can successfully put() as long as free < size which means you had previously called get() at least once. > My early understanding is that free tells that the Pool is free so that I > can put something > to the Pool which is not true. The terminology is very confusing. get() is similar to alloc and put() is similar to dealloc but you don't have to put() the same buffer that you got when you called get(). Please look at apps/tests/TestNetwork to see how to use a Pool. Pool is generally used together with a Queue. - om_p _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
