This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cyg_spinlock on uni machines


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]