Re: linux rt priority thread corrupt global variable?

Bill Huey \ (billh@gnuppy.monkey.org)
Thu, 8 May 2003 02:52:38 -0700


On Thu, May 08, 2003 at 02:03:35AM -0700, Ming Lei wrote:
> Related questions:
>
> Is linux kernel 2.4.10 considered strictly preemptive such as VxWorks or
> other RTOS? I guess 2.4.10 may simulate preemptive with running scheduler on
> every syscall or interrupt returns. Am I right?

No, it's not a fully preemptive kernel, but spreads preemption points
throughout the source tree, both directly and indirectly, instead. Spinlocks
are the primary mutex of choice in Linux and create atomic critical sections
that can't be preempted with respect to the normal Linux scheduler. Fully
preemptive systems tend to use sleepable locks with relaxed preemptability
within critical sections and add the possible option of priority inheritance
depending on the system.

If you're going to do RT Linux related stuff use RTLinux, RTAI or other
commerical options instead.

> Is printf() real-time priority thread safe?

Stock Linux is definitely not if I understand what you're saying and
if I understand the code correctly. :)

bill

-
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/