![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
Message queueing subsystem. More...
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_t * | advance_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 *) |
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
Definition in file queues.h.
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.
lp | A pointer to the LP's lp_struct which should have its bound updated in order to point to the next event to be processed |
Definition at line 93 of file queues.c.
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)
lp | A pointer to the LP's lp_struct for which we want to generate a system-wide unique mark |
Definition at line 270 of file queues.c.
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.
msg | The message to be added into some LP's bottom half. |
Definition at line 115 of file queues.c.
This function return the timestamp of the next-to-execute event
lp | A pointer to the LP's lp_struct for which we want to discover the timestamp of the next event |
Definition at line 62 of file queues.c.