This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
cyg_spinlock on uni machines
- To: ecos-discuss at sources dot redhat dot com
- Subject: [ECOS] cyg_spinlock on uni machines
- From: "Andre Asselin" <asselin at us dot ibm dot com>
- Date: Tue, 28 Aug 2001 16:11:17 -0400
- Cc: "Rajagopalan Thiruvenkatachary" <rajt at us dot ibm dot com>
I was looking at the new cyg_spinlock stuff in the kernel, and noticed that
the uniprocessor version of the functions don't disable scheduling or block
DSRs when a lock is acquired. In order for spinlocks to be useful, they
need to be able to lock between DSRs and "thread" level code (think of a
producer/consumer model for example). On a uniprocessor machine, that
means the scheduler and DSR dispatching need to be disabled while any lock
is acquired. On an MP machine, scheduling and DSR dispatching would be
disabled on the CPU that acquires the spinlock, and other CPUs would use
the spin mechanics to synchronize against the CPU that owns the lock.
On a related topic, I think it would be extremely nice while making SMP
enhancements to extend the DSR mechanism to be a general purpose (ala NT's
equivalent DPCs). This would allow you to define DSRs for any old purpose
and be able to queue them whenever you wanted. In an SMP environment, this
can allow better parallelism.
Andre Asselin
IBM ServeRAID Software Development
Research Triangle Park, NC