Probably GCC is keeping the value of the variable around in
some register. Did you declare the global variable as 'volatile'?
[as in "it can be modified by entities external to the flow of
the code"]. Try that.
On the other hand - being an integer, access should be atomic,
most of the time, but I would not really trust that, at least
portability wise. Protecting access to it with a mutex would
be a good idea ...
> Is linux kernel 2.4.10 considered strictly preemptive such as VxWorks or
> other RTOS?
Nope
> I guess 2.4.10 may simulate preemptive with running scheduler on
> every syscall or interrupt returns. Am I right?
You need the preemption patches or 2.5
I hope you are not trying to do serious real-time w/ Linux ... are you?
> Is printf() real-time priority thread safe?
Dunno - you'd have to check the internal implementation in
glibc. Last time I heard anything about it, it had some
mutex dangling around, but I could be wrong.
Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)
-
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/