In our codebase that we’re porting from VxWorks (on a PPC platform), we
have our own implementation of spinlocks written in PPC assembly.
What I would like to know is if we can replace these with POSIX
spinlocks in QNX, or not? The docs don’t give a very detailed
description of exactly what a spinlock does.
Our system has two CPUs on the board which share memory, but we do not
run SMP (of course: this is VxWroks ). Each CPU has its own memory
segment, but they do talk to each other. Our implementation of
spinlocks uses the special PowerPC instructions lwarx and stwcx to
implement locking among multiple processors that share memory. It can
be used for mutual exclusion among all threads of execution on all
processors that share a piece of memory.
Also, we have a spinlock function that does the above while disabling
interrupts.
Some of this code may be legacy, and no longer relevant in QNX; we’ll
investigate that of course, but I’m wondering if anyone has any thoughts
about porting this to POSIX / QNX.
Thx…
–
Paul D. Smith <pausmith@nortelnetworks.com> HASMAT–HA Software Mthds & Tools
“Please remain calm…I may be mad, but I am a professional.” --Mad Scientist
These are my opinions—Nortel Networks takes no responsibility for them.