This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
atomic singly linked lists
- To: ecos-discuss at sources dot redhat dot com
- Subject: [ECOS] atomic singly linked lists
- From: "Andre Asselin" <asselin at us dot ibm dot com>
- Date: Thu, 30 Aug 2001 11:30:32 -0400
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.
Andre Asselin
IBM ServeRAID Software Development
Research Triangle Park, NC