Commit Graph

93 Commits

Author SHA1 Message Date
Andrew Johnson
c44f90fd49 CAChannel: Prevent problems during cleanup
Guard channelCreated with requestsMutex.
Remove channel from provider before clearing channelCreated.
Simplify status handling.
2021-10-21 13:07:14 -05:00
Andrew Johnson
8cbd48faf3 Clean up CAChannel (done in disconnectChannel()) 2021-10-20 20:07:50 -05:00
Andrew Johnson
b8979b4152 Reject empty channel names 2021-10-20 20:06:55 -05:00
Andrew Johnson
ace1a82c12 caProvider: Convert caChannelList into a tsDLList
This should provide a significant performance boost when creating
many thousands of CA channels. The only time it is necessary to
traverse the list is in the CAChannelProvider's destructor; when
individual channels are added or destroyed they can insert or
remove themselves from the list without having to do a search.
2021-10-20 20:06:28 -05:00
Andrew Johnson
99432d6809 caProvider: Minor cleanup 2021-10-01 09:54:48 -05:00
Andrew Johnson
161eac3a38 caProvider: speed up monitor list handling
Not a major speed-up since the list of monitors is per-channel,
but using wptr::expired() is more efficient than wptr::lock().
2021-10-01 09:54:14 -05:00
Andrew Johnson
62cbbd6722 caChannel: Use epicsMutex and epicsGuard<> 2021-01-05 11:01:02 -08:00
Andrew Johnson
98e81a542e Use epicsMutex and epicsEvent instead of pv::data equivalents 2021-01-05 11:01:02 -08:00
Andrew Johnson
f9c40e96cf Collect ca_client_context operations
Each instance of the caContext class represents a separate CA context,
so each CAChannelProvider creates one and keeps a shared_ptr to it,
making that available to its channels and channel operations. These
also take their own shared_ptr to it as well so the context cannot be
destroyed while it might be needed.

A related caContext Attach object is intended to be short-lived, and
to be allocated on the stack. When created it saves the current CA
context for the thread, replacing it from the caContext given to its
constructor. CA operations will now use the attached context. When the
Attach destructor runs it detaches the thread from the current context
(checking still has the expected value) and re-attaches the thread to
any context that was saved by the constructor.
2021-01-05 11:01:02 -08:00
Andrew Johnson
25dde0f4ba Make Codacy happier 2021-01-05 11:01:02 -08:00
Andrew Johnson
06c2fb579f Replaced 4 notification threads with 2 notifierConveyors
Channel connection notifications are now handled by connectNotifier,
getDone, putDone and monitor events handled by resultNotifier.
A notifierConveyor is generic, and contains a queue and a thread.
You pass a Notification pointing to a NotifierClient to a Conveyor's
notifyClient() method, and the thread will call the client's
notifyClient() method once it reaches the front of the queue.

The conveyor threads stop when the caProvider is destroyed.
The queue stores weak pointers, so queued notifications won't prevent
client objects from being destroyed.
2021-01-05 11:01:02 -08:00
Andrew Johnson
2729903a10 Make the channelConnectThread per-provider
This passes the tests (on MacOS).
2021-01-05 11:01:02 -08:00
Andrew Johnson
44fda51935 Start of major overhaul
Moved duplicated EXCEPTION_GUARD macro to private header file.
Removed all DEBUG_LEVEL and similar prints.
Some reformatting and code simplification.
2021-01-05 11:01:02 -08:00
3ba6679e67 removed spaces at end of line 2020-04-15 08:17:03 -07:00
Heesterman, Peter J
208eef0962 Static analysis of epics base during the Codathon at Diamond. 2020-02-17 12:04:43 +00:00
mrkraimer
1204874481 implement field options 2018-09-27 10:02:00 -04:00
mrkraimer
e9d2114e96 latest changes to match caProvider.html 2018-09-24 13:45:21 -04:00
mrkraimer
10bb8039e5 fix problem with pvget and pvinfo 2018-09-13 08:36:33 -04:00
mrkraimer
7b7511fc0f channelConnectThread changes 2018-09-12 14:12:08 -04:00
mrkraimer
36e18bfd21 merge with epics-base 2018-09-10 14:11:19 -04:00
mrkraimer
ef623eef91 merge with epics-base 2018-09-10 13:46:50 -04:00
mrkraimer
8e40907171 fix issues 117 118 119 2018-08-13 14:19:10 -04:00
mrkraimer
39ede57fe2 change ChannelConnectThread to channelConnectThread 2018-08-10 15:11:02 -04:00
mrkraimer
f210c81e45 fix issue 119 2018-08-02 05:55:22 -04:00
mrkraimer
bac1307136 channel connect: call requester from channel access callback 2018-07-24 10:33:15 -04:00
mrkraimer
16268cc9d6 add channelConnectThread; should fix connecting to 50000 channels 2018-07-20 13:18:59 -04:00
mrkraimer
df45c70149 add putDoneThread and getDoneThread; fix issue 114 2018-07-14 11:46:26 -04:00
mrkraimer
184e92b346 delete stopMonitorThread; add monitorEventThread 2018-06-19 13:11:01 -04:00
mrkraimer
c377d35aee StopMonitorThread addNoEventsCallback replaces waitForNoEvent 2018-06-10 14:28:23 -04:00
mrkraimer
fe8184cf95 added aux thread to call ca_clear_subscription 2018-06-08 15:22:08 -04:00
mrkraimer
1e5f44d26e major changes to dbdToPv 2018-04-13 10:06:44 -04:00
mrkraimer
71303063a5 redo conversion between DBD and pvData 2018-03-31 06:46:25 -04:00
mrkraimer
9d234c6f2f make sure pvCopy has some field order as pvStructure 2018-02-19 12:31:44 -05:00
mrkraimer
99d20ae903 get and monitor: only report fields that have changed 2018-02-16 06:03:57 -05:00
mrkraimer
fcaeb414a0 termination and error handling changes.
epicsAtExit is no longer used to call ca_context_destroy.
It is now called from the destructor for CAChannelProvider.

Several changes were made for handling errors.
2018-02-06 10:20:29 -05:00
mrkraimer
cb21eb4f1e prevent CAChannel::disconnectChannel() from calling ca_clear_channel twice
This was causing a crash when exiting
2018-01-30 05:08:43 -05:00
mrkraimer
4d2e682a95 make changes suggested by andrew that remove warning messages 2018-01-29 10:19:56 -05:00
mrkraimer
d3ce104c33 fix issue #77 2017-12-23 06:35:23 -05:00
Michael Davidsaver
c4fe7150c9 caChannel: no need for weak pvRequest
Operations should keep their pvRequest alive.
The only danger of ref. loops with pvRequest
is via PVUnion, which is outside the scope
of pvAccessCPP.
2017-12-19 11:38:26 -06:00
mrkraimer
e4182d0b00 fix incorrect logic 2017-11-18 07:05:34 -05:00
mrkraimer
32d0ece858 fix all problems raised in issue #71 2017-11-17 15:18:21 -05:00
mrkraimer
784c6665a6 make pvRequest weak_pointer for get, put, and monitor 2017-11-14 09:11:27 -05:00
mrkraimer
6cd7de069a remove lastRequest messages; in activate only make callback if connected 2017-11-13 05:53:24 -05:00
mrkraimer
84976121d3 remove obsolete reference counting 2017-10-10 10:09:49 -04:00
mrkraimer
39c8eb90e0 remove more code for destroy 2017-09-06 14:06:41 -04:00
mrkraimer
a652086e91 channelGet, etc now have shared_ptr to Channel 2017-09-05 06:01:43 -04:00
mrkraimer
30650bfa48 merge latest from epics-base 2017-09-01 14:34:51 -04:00
mrkraimer
734ad725ea changes for RAII 2017-09-01 10:34:15 -04:00
Andrew Johnson
f1e938b039 Add epicsShare decorations to caProvider 2017-08-31 15:10:44 -05:00
Michael Davidsaver
146b445832 caProvider add reftrack counters 2017-08-30 17:51:52 -05:00