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


Nick Garnett writes:

>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.

You don't necessarily have to disable interrupts on architectures that
don't support an atomic compare and exchange instruction.  One
implementation of the list class can use atomic operations for those HALs
that support it, and another implementation could have a spinlock with an
ordinary list head pointer for those HALs that don't.  The latter
implementation would just fall back to using a spinlock to protect the
list, in which case, you'd only disable DSRs, not interrupts.

>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.

Agreed.

BTW, do you have any comments on the cyg_spinlock issue I posted
(http://sources.redhat.com/ml/ecos-discuss/2001-08/msg00893.html)?

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]