Documentation ¶
Index ¶
- Constants
- Variables
- func AllocateChans(nChan int)
- func CheckEvaluation() bool
- func Delete(e Elem, L *list.List) bool
- func DeleteAfter(t Time, L *list.List)
- func DeleteBefore(t Time, L *list.List)
- func GvtSetup(lpnum int)
- func Insert(e Elem, L *list.List) int
- func IsPresent(t Time, L *list.List) bool
- func NewList() *list.List
- func NoticeEvent(ev *Event, receiver Pid, data *LocalData)
- func Print(L *list.List)
- func Send(msg *Message)
- func SetLocalMin(time Time, pid Pid)
- func SharedSetup(lpn int, simt Time, f func(ev *Event, l *LocalData))
- func SimSetup(lpn int, simt Time, f func(ev *Event, l *LocalData))
- func Simulate(data *LocalData)
- func StartEvaluation(lpnum int)
- func Sync()
- func Unlock()
- type Elem
- type Event
- type EventHeap
- func (heap *EventHeap) Delete(evptr *Event) bool
- func (heap *EventHeap) DeleteExternId(ev *Event) Event
- func (heap *EventHeap) DeleteMatching(f func(ev *Event, a ...interface{}) bool, t ...interface{})
- func (heap *EventHeap) ExtractHead() *Event
- func (heap *EventHeap) GetCopy() EventHeap
- func (heap *EventHeap) GetMinTime() Time
- func (heap *EventHeap) GetString() string
- func (heap *EventHeap) Insert(evptr *Event) bool
- func (heap *EventHeap) IsEmpty() bool
- func (heap *EventHeap) Print()
- func (heap *EventHeap) PrintNodes()
- type Info
- type LocalData
- type Message
- type Node
- type Pid
- type Time
- type TimedMessage
Constants ¶
View Source
const ( /* as sender / receiver of a message */ SERVERID = -1 // server identifier /* in the field type of an event */ ANTIMSG = -4 // the message is an anti-message /* in the field time of an event */ ACK = -5 // the message is an acknowledgement GVTEVAL = -6 ABORTMSG = -7 RBMSG = -8 /* different types of ack messages */ MINE = -1 // the sender of the ACK assumes the responsibility for the message in the GVT evaluation YOURS = -2 // the sender of the ACK doesn't assume the responsibility for the message until the successive GVT evaluation /* significant constants */ FEWFREEPLACES = 4000 // the free space in an array is too low LISTLEN = 5000 // the max length of a queue HEAPSIZE = 500 // heap size TOOLARGE = 500 /* possible message colors */ WHITE = 1 BLACK = 2 NOTACOLOR = -1 /* logs creation constants */ LOGDIR = "logs/" PERM = 0666 GVTLOG = -3 /* server managment constants */ NOTIME = -2 ERR = -1 )
View Source
const ( LPNOTSTART = iota LPRUNNING = iota LPIDLE = iota LPSTOPPED = iota LPEVALGVT = iota )
possible process states
View Source
const EMPTY = -13
View Source
const EMPTYPLACE = 2
View Source
const EVARRSIZE = 2000
View Source
const MAXALLOCN = 1
View Source
const MAXBUFFER = 10000
View Source
const MAXTIME = 1<<31 - 1
View Source
const TOOFAR = 25 // limited optimism synchronization: sets how far from the GVT a LP can go
Variables ¶
View Source
var ( Lpnum int N_gvt int State []int8 N_rollback []int EventManager func(ev *Event, l *LocalData) EndTime Time StartTime time.Time )
View Source
var (
Chanptr *[]chan Message
)
View Source
var NPRINT int = 0
Functions ¶
func AllocateChans ¶
func AllocateChans(nChan int)
func NoticeEvent ¶
* creates and sends a message to the receiver that contains the event to be * noticed. Saves the related anti-message in sender local area
func SetLocalMin ¶
func StartEvaluation ¶
func StartEvaluation(lpnum int)
Types ¶
type Event ¶
type EventHeap ¶
type EventHeap []Node
func (*EventHeap) DeleteExternId ¶
* searches, deletes and returns an event using its identifier
func (*EventHeap) DeleteMatching ¶
func (*EventHeap) ExtractHead ¶
extracts the first event in the heap, that remains balanced
func (*EventHeap) GetMinTime ¶
returns the minimum time in the heap
type LocalData ¶
type LocalData struct { N_PROCESSED int SimTime Time Gvt Time IndexLP Pid FutureEvents EventHeap ProcessedEvents *list.List MsgSent *list.List AntiMsg2Annihilate *list.List OutgoingMsg *list.List Acked *list.List Pending bool GvtFlag bool }
func Initialize ¶
* every LP must perform an initialize() operation, that creates * the needed structures and variables
func SimInitialize ¶
* every LP must perform an initialize() operation, that creates all * the needed structures and variables
type TimedMessage ¶
func (TimedMessage) GetTime ¶
func (tm TimedMessage) GetTime() Time
type TimedMessage implements Elem interface
func (TimedMessage) IsEqual ¶
func (tm TimedMessage) IsEqual(e Elem) bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.