ZMailer

Mariano Absatz mailscanner at lists.com.ar
Mon Sep 22 21:56:41 IST 2003


Mmhhh...

I didn't try it yet, I'm just following the code by hand...

This one should to work but I have 2 questions:

1) At one point (within the do{...}while $batchempty) loop you say:

$UnsortedBatchesLeft = 40
  if $CriticalQueueSize>0 && $MsgsInQueue>=$CriticalQueueSize;
# SortedFiles is array of full pathnames now, not just filenames
if ($UnsortedBatchesLeft>0) {
  $UnsortedBatchesLeft--;
} else {
  @SortedFiles = sort { $ModDate{$a} <=> $ModDate{$b} } keys %ModDate;
}

(whereas $UnsortedBatchesLeft had previously been initialised to 0)...

What is the "40" for? Why do you decrement it if you will reset it to 40 on 
the next round thru the loop (supposing we can't lock & grab even 1 message 
for this batch)?

I can't see the use of $UnsortedBatchesLeft...

2) If we'd whish to further optimize the critical case scenario, we could 
even defer stat()'ing the queue files until we decided that we _will_ sort 
them (stat is an expensive system call), which would increase somehow the 
"normal" case processing time by means of a new loop... or we could add a 
flag within the "while($file = $queuedir->read())" loop so that if we have 
$CriticalQueueSize set _and_ we reach "$MsgsInQueue>=$CriticalQueueSize", we 
stop stat()'ing files


El 22 Sep 2003 a las 18:37, Julian Field escribió:

> Try this instead.
> 

--
Mariano Absatz
El Baby
----------------------------------------------------------
"An idiot with a computer is a faster, better idiot"
                                  -- Rich Julius





More information about the MailScanner mailing list