--- Em dom, 21/9/08, Walter Banks escreveu: > I couldn't get your link to open but am interested in > seeing your approach. I think the files area on yahoogroups.com are not accessible for non-member= s. If you want, I may send the files directly to your e-mail address. > For PIC12 and PIC16 the type of applications that are > implemented > can usually be implemented used compile time re-use of RAM > space. > This is even more so in applications that are implemented > as event > driven run to completion applications whose RAM > requirements > are both predictable and typically less. (Response time > average is > better fastest is lower that other approaches.) > = > Some of the PIC18 applications can benefit from dynamic > memory > allocation. > = > Most embedded real time allocations do not want dynamic > memory allocation because failure often affects more of the > application functionality than the alternatives. (Just ask > the anti lock brake systems that were failing in the mid > 80's > if dynamic allocation is a good idea) > = > Walter.. I agree, but sometimes it simplifies things. I don't use dynamic allocation for critical parts, but FreeRTOS needs it. I wrote a multi-thread application where just one thread have access to kay= board and LCD. The other threads send messages to the interface thread, by = allocating memory and filling it with the message, then passing a pointer t= hrough a queue. The interface thread shows the message and frees the memory. If there is no free memory, the thread that wants to send a message just wa= its, or if the message is not critical, just skip it. To avoid the fragmentation problem, all messages have a maximum length (the= LCD shows only 32 chars anyway) and the threads allocate always the same a= mount of memory for the messages. Regards, Isaac Novos endere=E7os, o Yahoo! que voc=EA conhece. Crie um email novo co= m a sua cara @ymail.com ou @rocketmail.com. http://br.new.mail.yahoo.com/addresses -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist