schedule.c File Reference

all comments except this one by the original authors this is the main file in which the pearl run-time environment is programmed More...

#include <stdio.h>
#include <sys/time.h>
#include <stdlib.h>
#include <time.h>
#include "schedule.h"
#include "mesq.h"
#include "collect.h"
#include "misc.h"
#include "statistics.h"
#include "event.h"
#include "startup.h"
#include "global.h"

Include dependency graph for schedule.c:


Defines

#define TIMEDIFF(a, b)   ((int)(((unsigned)(a))-((unsigned)(b))))

Functions

void hold_to (int dt)
void pearlwaiting (int reply_wait)
void pearlsend (int dest, int method, int *sp, int len)
int receive_time (int *mask, int dt, int *sp)
int pearlreceive (int *mask, int *sp)
char * stateString (int state)
void statistics (int procnr)
int catcherfunc ()
void schedule ()

Variables

char * wt = "pearl"
int data_type
FILE * statsFile
int throughzero = 0

Detailed Description

all comments except this one by the original authors this is the main file in which the pearl run-time environment is programmed

Pearl Compiler (c) 1989 University of Amsterdam by B.J. Overeinder & J.G. Stil

Author:
B.J. Overeinder & J.G. Stil
Date:
Wed Sep 26 15:44:05 2001

Define Documentation

#define TIMEDIFF a,
 )     ((int)(((unsigned)(a))-((unsigned)(b))))
 


Function Documentation

void hold_to int  dt  ) 
 

Delay the current process by 'dt' time units.

Parameters:
dt time units

void pearlwaiting int  reply_wait  ) 
 

void pearlsend int  dest,
int  method,
int *  sp,
int  len
 

Send a message to 'dest'. Mask contains the identifier of the remote method. The contents of the message is on the stack, starting at the position 'sp' points to. 'Len' is the length of the message. If the message is sent, first a check if the destination expects the messages is done. If so, the message is written on the destination's stack. If not, the message is put in the destination's message queue.

Parameters:
dest 
method 
sp starting position
len length of message

int receive_time int *  mask,
int  dt,
int *  sp
 

Delay process for 'dt' units and check if there are messages in its message queue. If so, remove process from process table again.

Parameters:
mask 
dt time units
sp 
Returns:

int pearlreceive int *  mask,
int *  sp
 

Look in the message queue of the pearl_current process if there are messages. If so, check if one of them is expected by the process. If so, duplicate message onto processes stack.

Parameters:
mask 
sp 
Returns:

char* stateString int  state  ) 
 

void statistics int  procnr  ) 
 

Put 'statistics' method-label in process's stack and schedule process one pearl_time.

Parameters:
procnr 
Returns:

int catcherfunc  ) 
 

void schedule  ) 
 

Schedule processes from the schedule queue as long as there are processes to be scheduled.

Returns:


Variable Documentation

char* wt = "pearl"
 

int data_type
 

FILE* statsFile
 

int throughzero = 0
 


Generated on Wed Apr 5 21:02:11 2006 for Sesame by  doxygen 1.4.6