Dear Ricardo,
Here is my take on your questions. See inline.

Ricardo . wrote:
>
> Dear all,
>
> I need your help to clear up a question: my application needs dynamic 
> memory, and literature that I've found some say it is not possible, 
> other say it's possible but it is not efficient.
>
> My questions are:
>
> 1 - Which version of TinyOS is possible to use dynamic memory?
In all the versions. You can write pure C code in TinyOS and all 
compilers I know support dynamic memory.
> 2 - Any mote supports dynamic memory?
All motes.
> 3 - What is the reason for dynamic memory is not efficient?
> 4 - Using dynamic memory greatly affects the efficiency, or is almost 
> imperceptible?
The answer of both question 3 and 4 is as follows. Dynamic memory means 
that you cannot predict memory usage at compile time and could go out of 
memory easily. You have to deallocate memory yoursef carefully. There 
are more chances of complicated errors. The allocating and deallocating 
memory is slow process and your code will execute slower. The static 
memory allocation is much more safer and faster.
You can also program your motes using Java. It has automatic garbage 
collection and will give you "out of memory" error. It is usually safer 
to use Java then C. Unlike C in Java you cannot have segmentation fault. 
You can use data structure like Vector that will grow dynamically etc.
>
>
> I wonder if anyone knows explain some of these issues (preferably all 
> =)), or if anyone know of any literature where I can get answers.
>
> Thankyou very much,
> --
> Ricardo

-- 
Faisal Aslam

University of Freiburg
http://cone.informatik.uni-freiburg.de/people/aslam/

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to