Experimental Physics and Industrial Control System
|
All,
based on a recent thread on core-talk [1], the current proposal for
a spinlock API to be put into libCom/osi looks like this:
typedef struct epicsSpin *epicsSpinId;
typedef unsigned long epicsSpinKey;
epicsShareFunc epicsSpinId epicsSpinCreate();
epicsShareFunc void epicsSpinDestroy(epicsSpinId);
epicsShareFunc void epicsSpinLock(epicsSpinId,
epicsSpinKey*);
epicsShareFunc int epicsSpinTryLock(epicsSpinId,
epicsSpinKey*);
epicsShareFunc void epicsSpinUnlock(epicsSpinId,
epicsSpinKey*);
These are intended to allow for granular locking, and to be safe to
use from an ISR (when applicable).
The implementation would be based on:
vxWorks - single core: intLock()
vxWorks - multi core: ISR-callable spinlocks
RTEMS: pthread_spin_lock() (or SuperCore spinlocks?)
Posix: pthread_spin_lock() (if implemented, else epicsMutex)
Default: epicsMutex
The epicsSpinKey is used for implementations that need to persist a
piece of status data between lock and unlock calls, e.g. intLock().
At the same time the existing epicsInterruptLock() API would be
deprecated.
Comments are very welcome.
Thanks,
~Ralph
[1]
http://www.aps.anl.gov/epics/core-talk/2012/msg00035.php
|
- Replies:
- Re: RFC: libCom/osi - new spinlock API Andrew Johnson
- Navigate by Date:
- Prev:
[Merge] lp:~jlmuir/epics-base/caput-help-F-opt-3.15 into lp:epics-base noreply
- Next:
Re: RFC: libCom/osi - new spinlock API Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
[Merge] lp:~jlmuir/epics-base/caput-help-F-opt-3.15 into lp:epics-base noreply
- Next:
Re: RFC: libCom/osi - new spinlock API Andrew Johnson
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|
ANJ, 26 Nov 2012 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
·
Search
·
EPICS V4
·
IRMIS
·
Talk
·
Bugs
·
Documents
·
Links
·
Licensing
·
|