The ROme OpTimistic Simulator  2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
queues.h File Reference

Message queueing subsystem. More...

#include <core/core.h>
#include <scheduler/process.h>
+ Include dependency graph for queues.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define last_event_timestamp(lp)   lvt(lp);
 

Functions

simtime_t get_min_in_transit (void)
 
simtime_t next_event_timestamp (struct lp_struct *)
 
msg_tadvance_to_next_event (struct lp_struct *)
 
void insert_bottom_half (msg_t *msg)
 
void process_bottom_halves (void)
 
unsigned long long generate_mark (struct lp_struct *)
 

Detailed Description

Message queueing subsystem.

This module implements the event/message queues subsystem.

This file is part of ROOT-Sim (ROme OpTimistic Simulator).

ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.

ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Author
Francesco Quaglia
Roberto Vitali
Alessandro Pellegrini
Date
March 16, 2011

Definition in file queues.h.

Function Documentation

msg_t* advance_to_next_event ( struct lp_struct lp)

This function advances the pointer to the last correctly executed event (bound). It is called right before the execution of it. This means that after this call, before the actual call to ProcessEvent(), bound is pointing to a not-yet-executed event. This is the only case where this can happen.

Author
Alessandro Pellegrini
Francesco Quaglia
Parameters
lpA pointer to the LP's lp_struct which should have its bound updated in order to point to the next event to be processed
Returns
The pointer to the event is going to be processed

Definition at line 93 of file queues.c.

+ Here is the caller graph for this function:

unsigned long long generate_mark ( struct lp_struct lp)

This function generates a mark value that is unique w.r.t. the previous values for each Logical Process. It is based on the Cantor Pairing Function, which maps 2 naturals to a single natural. The two naturals are the LP gid (which is unique in the system) and a non decreasing number which gets incremented (on a per-LP basis) upon each function call. It's fast to calculate the mark, it's not fast to invert it. Therefore, inversion is not supported at all in the simulator code (but an external utility is provided for debugging purposes, which can be found in src/lp_mark_inverse.c)

Author
Alessandro Pellegrini
Parameters
lpA pointer to the LP's lp_struct for which we want to generate a system-wide unique mark
Returns
A value to be used as a unique mark for the message within the LP

Definition at line 270 of file queues.c.

+ Here is the caller graph for this function:

void insert_bottom_half ( msg_t msg)

Insert a message in the bottom halft of a locally-hosted LP. Of course, the LP must be locally hosted. This is guaranteed by the fact that the only point where this function is called is from Send(), which checks whether the LP is hosted locally from this kernel instance or not.

Author
Alessandro Pellegrini
Parameters
msgThe message to be added into some LP's bottom half.

Definition at line 115 of file queues.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

simtime_t next_event_timestamp ( struct lp_struct lp)

This function return the timestamp of the next-to-execute event

Author
Alessandro Pellegrini
Francesco Quaglia
Parameters
lpA pointer to the LP's lp_struct for which we want to discover the timestamp of the next event
Returns
The timestamp of the next-to-execute event

Definition at line 62 of file queues.c.

+ Here is the caller graph for this function:

void process_bottom_halves ( void  )

Process bottom halves received by all the LPs hosted by the current KLT

Author
Alessandro Pellegrini

Definition at line 132 of file queues.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: