Ripples 1.0
High Performant Software Architecture For Transaction Processing
Loading...
Searching...
No Matches
Channels

Detailed Description

Channels are ways of exchanging data between threads. libfsds (Lock Free Data Structures) are used to form channels and exchange transactions or uni-directional messages.

Resource channel(s) are used to notify DNS query processing threads when a resource has changed. Messages are transactional in nature (request-response).

Query log channel is used to notify DNS query aprocessing threads when to flip query log buffers.

Log channel is used to send uni-directional log messages to application logging thread which in turn logs messages to file (disk).

Data Structures

struct  channel_bss_msg_s
 
struct  channel_bss_queue_s
 
struct  channel_bss_s
 
struct  channel_log_msg_s
 
struct  channel_log_s
 

Typedefs

typedef enum channel_bss_ops_e channel_bss_ops_t
 
typedef struct channel_bss_msg_s channel_bss_msg_t
 
typedef struct channel_bss_queue_s channel_bss_queue_t
 
typedef struct channel_bss_s channel_bss_t
 
typedef struct channel_log_msg_s channel_log_msg_t
 
typedef struct channel_log_s channel_log_t
 

Enumerations

enum  channel_bss_ops_e { CH_OP_RES_SET_RESOURCE1 = 0 , CH_OP_RES_SET_RESOURCE2 , CH_OP_QUERY_LOG_FLIP }
 

Functions

channel_bss_msg_tchannel_bss_msg_create (uint64_t id, channel_bss_ops_t op, void *p)
 
void channel_bss_msg_release (channel_bss_msg_t *msg)
 
int channel_bss_send (channel_bss_t *ch, channel_bss_msg_t *msg)
 
int channel_bss_recv (channel_bss_t *ch, channel_bss_msg_t **msg)
 
int channel_bssvl_send (channel_bss_t *ch, channel_bss_msg_t *msg)
 
int channel_bssvl_recv (channel_bss_t *ch, channel_bss_msg_t **msg)
 
uint64_t channel_bss_assign_msg_id (uint64_t *id_base)
 
channel_log_msg_tchannel_log_msg_create (uint32_t log_msg_id, char *log_msg, bool exit)
 
void channel_log_msg_release (channel_log_msg_t *msg)
 
int channel_log_send (channel_log_t *ch, channel_log_msg_t *msg)
 
int channel_log_recv (channel_log_t *ch, channel_log_msg_t **msg)
 

Typedef Documentation

◆ channel_bss_msg_t

Structure describes an bss channel message.

◆ channel_bss_ops_t

Enumerated bss channel operation codes.

◆ channel_bss_queue_t

Structure describes an bss bonded channel queue.

◆ channel_bss_t

typedef struct channel_bss_s channel_bss_t

Structure describes an bss channel, Channel has two queues. Each queue is unidirectional.

◆ channel_log_msg_t

Structure describes a log channel message.

◆ channel_log_t

typedef struct channel_log_s channel_log_t

Structure describes a log channel.

Enumeration Type Documentation

◆ channel_bss_ops_e

Enumerated bss channel operation codes.

Enumerator
CH_OP_RES_SET_RESOURCE1 

Op code for resource 1.

CH_OP_RES_SET_RESOURCE2 

Op code for resource 2.

CH_OP_QUERY_LOG_FLIP 

Op code for query log flip.

Function Documentation

◆ channel_bss_assign_msg_id()

uint64_t channel_bss_assign_msg_id ( uint64_t *  id_base)

Assign a new channel message ID from given base.

Base is incremented and value returned.

Parameters
id_base
Returns
uint64_t
Here is the caller graph for this function:

◆ channel_bss_msg_create()

channel_bss_msg_t * channel_bss_msg_create ( uint64_t  id,
channel_bss_ops_t  op,
void *  p 
)

Create a bss channel message object.

Parameters
idMessage ID
opMessage operation, see channel_bss_ops_t.
pPointer to data this message applies to.
Returns
On success returns pointer to newly created message. Caller is responsible for releasing the message via channel_bss_msg_release once message is no longer needed.
Here is the caller graph for this function:

◆ channel_bss_msg_release()

void channel_bss_msg_release ( channel_bss_msg_t msg)

Release (free memory) a bss message object.

Parameters
msgMessage to release.
Here is the caller graph for this function:

◆ channel_bss_recv()

int channel_bss_recv ( channel_bss_t ch,
channel_bss_msg_t **  msg 
)

Receive a message from support (bss) part of the channel.

This is used by vectorloop threads to receive message from support thread.

Parameters
chChannel to receive message on.
msgPointer where to place the received message.
Returns
On success returns 1, otherwise returns 0. 0 could only be returned if there are no messages in the channel.
Here is the caller graph for this function:

◆ channel_bss_send()

int channel_bss_send ( channel_bss_t ch,
channel_bss_msg_t msg 
)

Send a message on bss part of the channel.

This is used by support (bss) threads to send message to vectorloop thread.

Parameters
chChannel to send message on.
msgMessage to send.
Returns
On success returns 1, otherwise returns 0. 0 could only be returned if message could not be enqueued due channel being full.
Here is the caller graph for this function:

◆ channel_bssvl_recv()

int channel_bssvl_recv ( channel_bss_t ch,
channel_bss_msg_t **  msg 
)

Receive a message from vectorloop part of the channel.

This is used by support (bss) thread to receive message from vectorloop thread.

Parameters
chChannel to receive message on.
msgPointer where to place the received message.
Returns
On success returns 1, otherwise returns 0. 0 could only be returned if there are no messages in the channel.
Here is the caller graph for this function:

◆ channel_bssvl_send()

int channel_bssvl_send ( channel_bss_t ch,
channel_bss_msg_t msg 
)

Send a message on vectorloop part of the channel.

This is used by vectorloop thread to send message to support (bss) thread.

Parameters
chChannel to send message on.
msgMessage to send.
Returns
On success returns 1, otherwise returns 0. 0 could only be returned if message could not be enqueued due channel being full.
Here is the caller graph for this function:

◆ channel_log_msg_create()

channel_log_msg_t * channel_log_msg_create ( uint32_t  log_msg_id,
char *  log_msg,
bool  exit 
)

Create a new log channel message object.

Parameters
log_msg_idLog message ID, see app_log_msg_id_t.
log_msgLog message string, can be NULL.
exitIs this a fatal message, meaning should the application exit once message is logged.
Returns
On success returns pointer to newly created message. Caller is responsible for releasing the message via channel_log_msg_release once message is no longer needed.
Here is the caller graph for this function:

◆ channel_log_msg_release()

void channel_log_msg_release ( channel_log_msg_t msg)

Release (free memory) a log channel message object.

Parameters
msgMessage object to release.
Here is the caller graph for this function:

◆ channel_log_recv()

int channel_log_recv ( channel_log_t ch,
channel_log_msg_t **  msg 
)

Receive a message from log channel.

This is used by log thread to receive message from other thread.

Parameters
chChannel to receive message on.
msgPointer where to place the received message.
Returns
On success returns 1, otherwise returns 0. 0 could only be returned if there are no messages in the channel.
Here is the caller graph for this function:

◆ channel_log_send()

int channel_log_send ( channel_log_t ch,
channel_log_msg_t msg 
)

Send a message on log channel.

This is used by threads threads to send message to log thread.

Parameters
chChannel to send message on.
msgMessage to send.
Returns
On success returns 1, otherwise returns 0. 0 could only be returned if message could not be enqueued due channel being full.
Here is the caller graph for this function: