ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
Functions
msg_queue.h File Reference

Message queue datatype. More...

#include <core/core.h>
#include <lp/msg.h>
Include dependency graph for msg_queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void msg_queue_global_init (void)
 
void msg_queue_global_fini (void)
 Finalizes the message queue at the node level.
 
void msg_queue_init (void)
 Initializes the message queue for the current thread.
 
void msg_queue_fini (void)
 Finalizes the message queue for the current thread.
 
struct lp_msgmsg_queue_extract (void)
 Extracts the next message from the queue. More...
 
simtime_t msg_queue_time_peek (void)
 Peeks the timestamp of the next message from the queue. More...
 
void msg_queue_insert (struct lp_msg *msg)
 Inserts a message in the queue. More...
 

Detailed Description

Message queue datatype.

Message queue datatype

Function Documentation

◆ msg_queue_extract()

struct lp_msg* msg_queue_extract ( void  )

Extracts the next message from the queue.

Returns
a pointer to the message to be processed or NULL if there isn't one

The extracted message is a best effort lowest timestamp for the current thread. Guaranteeing the lowest timestamp may increase the contention on the queues.

◆ msg_queue_insert()

void msg_queue_insert ( struct lp_msg msg)

Inserts a message in the queue.

Parameters
msgthe message to insert in the queue

◆ msg_queue_time_peek()

simtime_t msg_queue_time_peek ( void  )

Peeks the timestamp of the next message from the queue.

Returns
the lowest timestamp of the next message to be processed or SIMTIME_MAX is there's no message to process

This returns the lowest timestamp of the next message to be processed for the current thread. This is calculated in a precise fashion since this value is used in the gvt calculation.