EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: generalTime/epicsTimeGetCurrent and casr questions
From: William Layne via Tech-talk <[email protected]>
To: [email protected]
Date: Sun, 10 Mar 2019 23:07:48 -0400
Excuse the second email address.

Mark - Our situation looks like what is happening on "Ferrari". I'm guessing the CA API is allowing the user to continually create channels. Seems like both the IOC and CA API should be able to know that they have already subscribed. I'll go take a look at how our users are subscribing.

David - Thanks for that info, didn't know about pthread_once doing something similar. I'll stub out epicsTimeGetCurrent to call my provider and see what effect that has. 

Will report back findings and possibly have more detailed questions after some testing sessions tomorrow.

Thanks,
Casey




On Sun, Mar 10, 2019, 10:20 PM Michael Davidsaver via Tech-talk <[email protected]> wrote:
On 3/9/19 2:17 PM, Johnson, Andrew N. via Tech-talk wrote:
> William — regarding your question about generalTime, I believe Michael Davidsaver has some ideas about rewriting the generalTime code to try and reduce the contentions on that mutex (it’s probably the one you named but I don’t have the code in front of me to check right now). I don’t know how far he has got with that if anywhere though.

Yes, 'gtPvt.timeListLock' is the one I was thinking of.  Though 'onceLock' in posix/osdThread.c,
and whatever is behind pthread_once() will also contribute.  There is a lot going on behind
epicsTimeGetCurrent().


This kicked something loose in my memory.  I've refreshed an old patch
which adds a global flag to short-circuit the bulk of the overhead in
epicsTimeGetCurrent() in the common case of only the default provider.

https://code.launchpad.net/~epics-core/epics-base/+git/Com/+merge/364220


Which could go along with my previous work to replace calls to fetch current
time with calls to fetch monotonic time.

https://code.launchpad.net/~epics-core/epics-base/+git/Com/+merge/361380

I was tempted to speculate that this might be slightly faster.  It's good that
I refrained.  As currently implemented on Linux.  epicsMonotonicGet() is calling
clock_gettime() with CLOCK_MONOTONIC_RAW which at least on my laptop (Linux 4.19)
appears to be surprisingly slower to call than CLOCK_REALTIME, or indeed CLOCK_MONOTONIC.


Time needed to make 1000000 calls to clock_gettime() in a loop w/

CLOCK_MONOTONIC_RAW  ~500ms

CLOCK_REALTIME and CLOCK_MONOTONIC  ~35ms

CLOCK_MONOTONIC_COARSE and CLOCK_REALTIME_COARSE  ~10ms

References:
generalTime/epicsTimeGetCurrent and casr questions Layne (US), William C via Tech-talk
Re: generalTime/epicsTimeGetCurrent and casr questions Mark Rivers via Tech-talk
Re: generalTime/epicsTimeGetCurrent and casr questions Johnson, Andrew N. via Tech-talk
Re: generalTime/epicsTimeGetCurrent and casr questions Michael Davidsaver via Tech-talk

Navigate by Date:
Prev: Re: generalTime/epicsTimeGetCurrent and casr questions Michael Davidsaver via Tech-talk
Next: EPICS June 2019: Abstract Submission is open Ralph Lange via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: generalTime/epicsTimeGetCurrent and casr questions Michael Davidsaver via Tech-talk
Next: Re: generalTime/epicsTimeGetCurrent and casr questions Michael Davidsaver via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 11 Mar 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·