while($timestamp <= $numevents) { print "\ntimestamp: $timestamp, numevents: $numevents\n"; foreach $pid (@p_s) { my $p_e = 0, $p_t = 0; #for every process pop the first event and examine it if($p_e = pop @{$p_s[$pid]}) { #if process-event has receiver-dependency then push it back on the stack if($receiver{$p_e}) { push (@{$p_s[$pid]},$p_e); } else { my $s_o = 0; #else if process-event has sender-obligation then update sender and reciever hashes if($s_o = $sender{$p_e}) { delete $sender{$p_e}; delete $receiver{$s_o}; } #and then enqueue process-event with process-timestamp in schedule hash if($p_e =~ m/(\d)-(\d)/) { $p_t = "$timestamp.$1" } else { print "\nerror parsing processor-event signature\n"; } $schedule{$p_e} = $p_t; unshift (@totalorder, $p_t); } } } $timestamp++; }