|
From: | Jonathan Larmour |
Subject: | Re: [lwip-users] use of static variables in tcp_in.c |
Date: | Thu, 04 Oct 2007 18:54:10 +0100 |
User-agent: | Thunderbird 1.5.0.12 (X11/20070530) |
Goldschmidt Simon wrote:
I think it would be a good thing moving from global variables to parameters, but I remember adam writing about intentionally using global variables as a design goal in embedded systems (using a smaller stack, favouring statically configured memory) which is an opinion I don't share, but we would have to discuss that!
I think Adam made a good design choice. The stack is designed to be single-threaded so what's the point doing otherwise. I would add, though, that it's not just a question of stack space (although that's a good enough reason on its own), but also code space and performance - marshalling all the various arguments into the right position for function calls would take extra code and time. It would also add to register pressure.
Incidentally there are other ways to deal with different priority of operations depending on the thread priority of the threads using the stack.
Jifl -- eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071. >>>> Visit us on stand 810 at The Embedded Systems Show 2007, NEC <<<< >>>> Oct 17-18 Birmingham, UK http://www.edaexhibitions.com/ess/ <<<< ------["The best things in life aren't things."]------ Opinions==mine
[Prev in Thread] | Current Thread | [Next in Thread] |