EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Redundancy Patch: libCom
From: Andrew Johnson <[email protected]>
To: EPICS core-talk <[email protected]>
Date: Fri, 16 Nov 2007 17:25:47 -0600
Andrew Johnson wrote:
**************
Modified
**************

# source files

(6) base-3.14.9/src/libCom/osi/epicsMutex.cpp
    The function epicsMutexLockWithTimeout() is added.

(7) base-3.14.9/src/libCom/osi/epicsMutex.h
    The constant LOG_LAST_OWNER is defined. The function
    epicsMutexLockWithTimeout and epicsMutexOsdLockWithTimeout are
    declared.

I would like to see modifications to libCom/test/epicsMutexTest.cpp to
comprehensively test these changes, checking for all combinations of
simultaneous calls to lock and lock with timeout on the same mutex. I am not an expert on pthreads and I haven't had a chance to look at the
posix implementation in detail, but it definitely needs to be examined
closely. We will need implementations for RTEMS and Windows as well — the first should not be a problem, but I don't know anything about
Windows.


(8) base-3.14.9/src/libCom/osi/epicsThread.h
    The function epicsThreadDelete is declared.

As with both Eric and Kay, I have a fundamental problem with adding this functionality: Deleting a thread leaves the software in an undefined state; it is not possible to continue operation after doing this since the deleter has no knowledge of what resources the thread has allocated or reserved at the moment it was cancelled. This is precisely why the epicsThread APIs have not supported the ability to delete a thread and all thread shutdown must be performed by having the thread itself return to its caller.


(9) base-3.14.9/src/libCom/osi/epicsTime.h
    The function epicsTimeGetTicks is declared.

A 'tick' has no meaning in some operating systems, and could be wildly
different in size.  We removed all references to ticks from the IOC
portable code; why is this needed?


(10) base-3.14.9/src/libCom/osi/os/posix/osdMutex.c
    The structure epicsMutexOSD is extended and the function
    epicsMutexOsdLockWithTimeout is implemented.

(11) base-3.14.9/src/libCom/osi/os/posix/osdThread.c
    The function epicsThreadDelete is implemented.

(12) base-3.14.9/src/libCom/osi/os/posix/osdTime.cpp
    The function epicsTimeGetTicks is implemented.

(13) base-3.14.9/src/libCom/osi/os/vxWorks/iocClock.c
    The function epicsTimeGetTicks is implemented.

(14) base-3.14.9/src/libCom/osi/os/vxWorks/osdMutex.c
    The function epicsMutexOsdLockWithTimeout is implemented.

(15) base-3.14.9/src/libCom/osi/os/vxWorks/osdThread.c
     The function epicsThreadDelete is implemented.

The above changes implement the facilities discussed above for vxWorks
and Posix-compliant OSs.  If we accept the need for them, we will also
need implementations for WIN32 and RTEMS.


**************
Added
**************

(3) base-3.14.9/src/libCom/osi/os/Linux/osdFindSymbol.c
    Implement the function epicsFindSymbol for Linux.

(4) base-3.14.9/src/libCom/osi/os/posix/osdFindSymbol.c
    Implement the function epicsFindSymbol for posix.

This functionality is not required if suitable function pointers are
provided that the Base code calls at the appropriate place.  It will
not be possible to create an RTEMS implementation of epicsFindSymbol()
until the RTEMS OS incorporates Till Strauman's 'cexp' shell, which
apparently is not likely to happen in the near term.  I do not know
whether it will be possible to implement this on Windows.

- Andrew
--
When a distinguished but elderly scientist states that something is
possible, he is almost certainly right.  When he states that something
is impossible, he is very probably wrong.  -- Arthur C. Clarke

Replies:
Re: Redundancy Patch: libCom Liu, Gongfa
References:
Redundancy Patch: libCom Andrew Johnson

Navigate by Date:
Prev: Re: Redundancy Patch: db Andrew Johnson
Next: Re: Redundancy Patch: makeBaseApp Andrew Johnson
Index: 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Redundancy Patch: libCom Andrew Johnson
Next: Re: Redundancy Patch: libCom Liu, Gongfa
Index: 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·