Re: [RFC] Migrating net/sched to new module interface

Werner Almesberger (wa@almesberger.net)
Fri, 14 Feb 2003 23:28:18 -0300


Roman Zippel wrote:
> Yes, and now compare how the solutions differ when the data is static and
> when it's allocated.

Do they ? Even if the data is static, it can become invalid
(in the sense that accessing it from a callback would lead
to some kind of undesirable behaviour, even though the access
itself would work), so I don't quite see why the difference
would matter.

Example:

static ... common_callback(...)
{
switch (my_state) {
...
}
}

...
my_state = A;
register_fancy_timer_A(&me_A,common_callback);
...
unregister_fancy_timer_A(&me_A);
my_state = B;
/* stray fancy_timer_A call to common_callback would
trigger action for state B */
...
register_fancy_timer_B(&me_B,common_callback);
...

Depending on "my_state", the callback would perform different
actions. (The "fancy timers" would be some timer-like service
that doesn't del_timer_sync.)

This is getting to abstract. Why don't you just say where you
see the difference ? :-)

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/