added new priority parameter

This commit is contained in:
Jeff Hill
2001-08-23 21:08:42 +00:00
parent 984d8cac2b
commit dd723369fe
4 changed files with 66 additions and 43 deletions
+43 -38
View File
@@ -47,6 +47,7 @@ public:
struct CASG;
class inetAddrID;
class caServerID;
struct caHdrLargeArray;
extern epicsThreadPrivateId caClientCallbackThreadId;
@@ -58,8 +59,8 @@ public:
virtual ~cac ();
// beacon management
void beaconNotify ( const inetAddrID &addr,
const epicsTime &currentTime );
void beaconNotify ( const inetAddrID & addr,
const epicsTime & currentTime );
void repeaterSubscribeConfirmNotify ();
// outstanding IO count management routines
@@ -81,10 +82,12 @@ public:
// channel routines
void installNetworkChannel ( nciu &, netiiu *&piiu );
bool lookupChannelAndTransferToTCP ( unsigned cid, unsigned sid,
ca_uint16_t typeCode, arrayElementCount count, unsigned minorVersionNumber,
const osiSockAddr &, const epicsTime & currentTime );
ca_uint16_t typeCode, arrayElementCount count,
unsigned minorVersionNumber, const osiSockAddr &,
const epicsTime & currentTime );
void uninstallChannel ( nciu & );
cacChannel & createChannel ( const char *name_str, cacChannelNotify &chan );
cacChannel & createChannel ( const char *name_str,
cacChannelNotify &chan, cacChannel::priLev pri );
void registerService ( cacService &service );
// IO request stubs
@@ -137,52 +140,54 @@ public:
void notifyDestroyFD ( SOCKET ) const;
void uninstallIIU ( tcpiiu &iiu );
bool preemptiveCallbackEnable () const;
double beaconPeriod ( const nciu & chan ) const;
private:
ipAddrToAsciiEngine ipToAEngine;
cacServiceList services;
tsDLList < tcpiiu > iiuList;
ipAddrToAsciiEngine ipToAEngine;
cacServiceList services;
chronIntIdResTable
< nciu > chanTable;
< nciu > chanTable;
chronIntIdResTable
< baseNMIU > ioTable;
< baseNMIU > ioTable;
chronIntIdResTable
< CASG > sgTable;
< CASG > sgTable;
resTable
< bhe, inetAddrID > beaconTable;
< bhe, inetAddrID > beaconTable;
resTable
< tcpiiu, caServerID > serverTable;
tsFreeList
< class netReadNotifyIO, 1024 >
freeListReadNotifyIO;
freeListReadNotifyIO;
tsFreeList
< class netWriteNotifyIO, 1024 >
freeListWriteNotifyIO;
freeListWriteNotifyIO;
tsFreeList
< class netSubscription, 1024 >
freeListSubscription;
epicsTime programBeginTime;
double connTMO;
mutable epicsMutex mutex;
epicsMutex callbackMutex;
epicsMutex serializePendIO;
epicsMutex serializePendEvent;
epicsEvent ioDone;
epicsEvent noRecvThreadsPending;
epicsEvent iiuUninstal;
epicsTimerQueueActive *pTimerQueue;
char *pUserName;
class udpiiu *pudpiiu;
class searchTimer *pSearchTmr;
freeListSubscription;
epicsTime programBeginTime;
double connTMO;
mutable epicsMutex mutex;
epicsMutex callbackMutex;
epicsMutex serializePendIO;
epicsMutex serializePendEvent;
epicsEvent ioDone;
epicsEvent noRecvThreadsPending;
epicsEvent iiuUninstal;
epicsTimerQueueActive *pTimerQueue;
char *pUserName;
class udpiiu *pudpiiu;
class searchTimer *pSearchTmr;
class repeaterSubscribeTimer
*pRepeaterSubscribeTmr;
void *tcpSmallRecvBufFreeList;
void *tcpLargeRecvBufFreeList;
cacNotify & notify;
unsigned initializingThreadsPriority;
unsigned maxRecvBytesTCP;
unsigned pndRecvCnt;
unsigned readSeq;
unsigned recvThreadsPendingCount;
bool enablePreemptiveCallback;
*pRepeaterSubscribeTmr;
void *tcpSmallRecvBufFreeList;
void *tcpLargeRecvBufFreeList;
cacNotify & notify;
unsigned initializingThreadsPriority;
unsigned maxRecvBytesTCP;
unsigned pndRecvCnt;
unsigned readSeq;
unsigned recvThreadsPendingCount;
bool enablePreemptiveCallback;
void flushRequestPrivate ();
void run ();
+7
View File
@@ -22,6 +22,13 @@
#include "cacIO.h"
#undef epicsExportSharedSymbols
const cacChannel::priLev cacChannel::priorityMax = 100u;
const cacChannel::priLev cacChannel::priorityMin = 0u;
const cacChannel::priLev cacChannel::priorityDefault = priorityMin;
const cacChannel::priLev cacChannel::priorityLinksDB = priorityMax;
const cacChannel::priLev cacChannel::priorityArchive = ( priorityMax - priorityMin ) / 2;
const cacChannel::priLev cacChannel::priorityOPI = priorityMin;
cacChannel::~cacChannel ()
{
}
+14 -3
View File
@@ -124,6 +124,14 @@ public:
//
class epicsShareClass cacChannel {
public:
typedef unsigned priLev;
static const priLev priorityMax;
static const priLev priorityMin;
static const priLev priorityDefault;
static const priLev priorityLinksDB;
static const priLev priorityArchive;
static const priLev priorityOPI;
typedef unsigned ioid;
enum ioStatus { iosSynch, iosAsynch };
@@ -159,6 +167,7 @@ public:
// exceptions
class badString {};
class badType {};
class badPriority {};
class outOfBounds {};
class badEventSelection {};
class noWriteAccess {};
@@ -188,7 +197,8 @@ public:
struct cacService : public tsDLNode < cacService > {
public:
virtual cacChannel * createChannel (
const char *pName, cacChannelNotify & ) = 0;
const char *pName, cacChannelNotify &,
cacChannel::priLev = cacChannel::priorityDefault ) = 0;
virtual void show ( unsigned level ) const = 0;
};
@@ -196,7 +206,8 @@ class cacServiceList {
public:
epicsShareFunc void registerService ( cacService &service );
epicsShareFunc cacChannel * createChannel (
const char *pName, cacChannelNotify & );
const char *pName, cacChannelNotify &,
cacChannel::priLev = cacChannel::priorityDefault );
epicsShareFunc void show ( unsigned level ) const;
private:
tsDLList < cacService > services;
@@ -207,7 +218,7 @@ epicsShareExtern cacServiceList cacGlobalServiceList;
epicsShareFunc int epicsShareAPI ca_register_service ( struct cacService *pService );
inline cacChannel::cacChannel ( cacChannelNotify &notify ) :
inline cacChannel::cacChannel ( cacChannelNotify & notify ) :
callback ( notify )
{
}
+2 -2
View File
@@ -30,14 +30,14 @@ void cacServiceList::registerService ( cacService &service )
}
cacChannel * cacServiceList::createChannel (
const char *pName, cacChannelNotify &chan )
const char * pName, cacChannelNotify & chan, cacChannel::priLev pri )
{
cacChannel *pChanIO = 0;
epicsAutoMutex locker ( this->mutex );
tsDLIterBD < cacService > iter = this->services.firstIter ();
while ( iter.valid () ) {
pChanIO = iter->createChannel ( pName, chan );
pChanIO = iter->createChannel ( pName, chan, pri );
if ( pChanIO ) {
break;
}