Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > BestEffortMessaging
diff LossyCom.h @ 5:95a03e431480
corrected comments and variable renaming
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Tue, 13 Mar 2012 19:07:49 +0100 |
| parents | 7ba5a3a6102d |
| children |
line diff
1.1 --- a/LossyCom.h Tue Mar 13 18:22:12 2012 +0100 1.2 +++ b/LossyCom.h Tue Mar 13 19:07:49 2012 +0100 1.3 @@ -4,9 +4,11 @@ 1.4 * their status and pass work around. This is to avoid idling cores that occupy 1.5 * the Masterlock. 1.6 * 1.7 - * The communication entities poll a central trigger counter that increases when 1.8 - * there are new messages. However it's not guaranteed that the increase of the 1.9 - * counter reflects the number of new messages. 1.10 + * The communication entities poll a central trigger counter and per receiver 1.11 + * trigger counter that increase when there are new messages. 1.12 + * However it's not guaranteed that the increase of the counter reflects the 1.13 + * number of new messages. The new trigger counter can even be lower than the 1.14 + * last see counter for some receiver. 1.15 * 1.16 * The messages consist of a single 64bit word so it can be written in one 1.17 * operation and therefore avoiding inconsistent messages. 1.18 @@ -15,10 +17,13 @@ 1.19 * when acquiring the communication endpoint. 1.20 * 1.21 * The message passing is handled by a central struct that is used w/o any lock. 1.22 - * It consists of a array messages for the number of communicating entities. The 1.23 - * number of entities is fixed at initialization. 1.24 + * It consists of a array messages for the number of communicating endpoints. 1.25 + * The number of endpoints is fixed at initialization time. 1.26 */ 1.27 1.28 +#ifndef LOSSYCOM_H 1.29 +#define LOSSYCOM_H 1.30 + 1.31 #include <stdint.h> 1.32 1.33 /*********************************** 1.34 @@ -58,8 +63,8 @@ 1.35 * Central communication structure. 1.36 */ 1.37 typedef struct{ 1.38 - volatile uint16_t BroadcastTriggerCounter; 1.39 - volatile uint16_t* p2pTriggerCounter; 1.40 + volatile uint16_t broadcastTriggerCounter; 1.41 + volatile uint16_t* p2pTriggerCounters; 1.42 uint16_t numEndpoints; 1.43 lossyCom__msg_t* outboxArray; 1.44 }lossyCom__exchange_t; 1.45 @@ -68,12 +73,12 @@ 1.46 * Endpoint data structure. 1.47 */ 1.48 typedef struct { 1.49 + lossyCom__exchange_t* centralExchange; 1.50 + lossyCom__endpointID_t endpointID; 1.51 + lossyCom__msgHandler msgHandler; 1.52 + void* msgHandlerData; 1.53 uint16_t lastReceivedBroadcastTrigger; 1.54 uint16_t lastReceivedp2pTrigger; 1.55 - lossyCom__endpointID_t endpointID; 1.56 - lossyCom__exchange_t* centralExchange; 1.57 - lossyCom__msgHandler msgHandler; 1.58 - void* msgHandlerData; 1.59 } lossyCom__endpoint_t; 1.60 1.61 /*********************************** 1.62 @@ -95,4 +100,6 @@ 1.63 lossyCom__endpointID_t receiverEndpointID, 1.64 lossyCom__msgBody_t msg); 1.65 1.66 -void lossyCom__receiveMsg(lossyCom__endpoint_t* localEndpoint); 1.67 \ No newline at end of file 1.68 +void lossyCom__receiveMsg(lossyCom__endpoint_t* localEndpoint); 1.69 + 1.70 +#endif //LOSSYCOM_H 1.71 \ No newline at end of file
