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]

Re: atomic singly linked lists


"Andre Asselin" <asselin@us.ibm.com> writes:

> Another enhancement suggestion for eCos: one data structure I've found very
> useful when writing drivers on NT is the atomic singly linked list.  This
> is a list that allows you to push/pop an item at the front of the list, and
> on CPUs that support an atomic exchange instruction (like P3), to do it
> without having to acquire and release a spinlock.  This is extremely useful
> when maintaining a list of free items that get allocated at thread level
> and freed at DSR level.  Using the atomic list means you don't have to
> block DSRs while the thread is allocating an item.  Its a nice optimization
> on uniprocessor systems, and on SMP systems, the benefits are even greater.
> 

Yep. I'm a big fan of lock-free synchronization techniques. I would
have liked to see them used more in eCos. One reason for not using
these much is that anything that eCos provides has to work on all the
platforms we support. Not all have support for the compare-and-swap
(or LL/SC) operation this needs. Having to implement it by disabling
interrupts is somewhat less compelling.

Of course there is nothing to stop you implementing such operations in
your own code, if your platform has the necessary support.
Particularly if you are writing drivers for your own hardware.


-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK


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