lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] use of static variables in tcp_in.c


From: address@hidden
Subject: Re: [lwip-users] use of static variables in tcp_in.c
Date: Thu, 04 Oct 2007 20:07:05 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)



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.

What you say is true, of course when using the stack single-threaded. But when it comes to multithreading, there are some restrictions with this design choice. In the spirit of 'lw', however, I think we'll stay with the current implementation...

Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]