48 msg_t *control_antimessage;
49 msg_t *msg, *msg_prev;
56 while (msg != NULL && msg->timestamp > simtime) {
59 pack_msg(&control_antimessage, msg->receiver, msg->sender,
63 control_antimessage->message_kind = control;
64 Send(control_antimessage);
66 list_delete_by_content(lp->rendezvous_queue, msg);
72 bool anti_control_message(
msg_t * msg)
74 #ifndef HAVE_CROSS_STATE 77 msg_t *old_rendezvous;
81 struct lp_struct *receiver = find_lp_by_gid(msg->receiver);
84 old_rendezvous =
list_tail(receiver->queue_in);
85 while (old_rendezvous != NULL
88 old_rendezvous =
list_prev(old_rendezvous);
91 if (old_rendezvous == NULL) {
95 if (old_rendezvous->timestamp <=
lvt(lid_receiver)) {
99 while (receiver->
bound != NULL
100 && receiver->
bound->timestamp >=
101 old_rendezvous->timestamp) {
108 receiver->
state = LP_STATE_ROLLBACK;
115 receiver->ECS_index = 0;
116 receiver->wait_on_rendezvous = 0;
127 bool reprocess_control_msg(
msg_t * msg)
138 bool receive_control_msg(
msg_t * msg)
144 #ifdef HAVE_CROSS_STATE 145 struct lp_struct *receiver = find_lp_by_gid(msg->receiver);
157 if (receiver->
state == LP_STATE_ROLLBACK ||
158 receiver->
state == LP_STATE_SILENT_EXEC) {
162 ecs_install_pages(msg);
163 receiver->
state = LP_STATE_READY_FOR_SYNCH;
168 if (receiver->
state == LP_STATE_ROLLBACK ||
169 receiver->
state == LP_STATE_SILENT_EXEC) {
173 setup_ecs_on_segment(msg);
174 receiver->
state = LP_STATE_READY_FOR_SYNCH;
180 if (receiver->
state == LP_STATE_ROLLBACK ||
181 receiver->
state == LP_STATE_SILENT_EXEC) {
186 receiver->wait_on_rendezvous = 0;
187 receiver->
state = LP_STATE_READY;
190 current = find_lp_by_gid(msg->receiver);
191 current_lvt = msg->timestamp;
204 "Trying to handle a control message which is meaningless at receive time: %d\n",
214 bool process_control_msg(
msg_t * msg)
217 #ifdef HAVE_CROSS_STATE 224 #ifdef HAVE_CROSS_STATE 225 struct lp_struct *receiver = find_lp_by_gid(msg->receiver);
230 copy = rsalloc(
sizeof(
msg_t));
232 list_insert(receiver->rendezvous_queue, timestamp, copy);
236 receiver->
state = LP_STATE_WAIT_FOR_UNBLOCK;
238 pack_msg(&control_msg, msg->receiver, msg->sender,
241 control_msg->message_kind = positive;
249 "Trying to handle a control message which is meaningless at schedule time: %d\n",
ECS protocol: a remote LP is asked for a certain set of pages.
msg_t * bound
Pointer to the last correctly processed event.
ECS protocol: the sender LP has been synchronized and is now blocked.
void force_LP_checkpoint(struct lp_struct *lp)
Core ROOT-Sim functionalities.
Anything after this value is considered as an impossible message.
The ROOT-Sim scheduler main module header.
Separation value between model and platform messages.
__thread struct lp_struct * current
This is a per-thread variable pointing to the block state of the LP currently scheduled.
ECS protocol: start synchronizing two LPs for a page fault.
#define list_insert(li, key_name, data)
Insert a new node in the list.
#define INFTY
Infinite timestamp: this is the highest timestamp in a simulation run.
double simtime_t
This defines the type with whom timestamps are represented.
Memory Manager main header.
ECS protocol: the destination LP can resume its normal execution.
void Send(msg_t *msg)
Send a message.
unsigned long long rendezvous_mark
Unique identifier of the message, used for antimessages.
void pack_msg(msg_t **msg, GID_t sender, GID_t receiver, int type, simtime_t timestamp, simtime_t send_time, size_t size, void *payload)
Pack a message in a platform-level data structure.
short unsigned int state
Current execution state of the LP.
ECS protocol: modified pages are sent back to the owner LP.
ECS protocol: an ECS synchronization should be rolled back.
ECS protocol: the sender LP is giving a lease on a set of pages.
Event & Cross State Synchornization.
bool LogState(struct lp_struct *lp)