Article View: borland.public.cppbuilder.nativeapi
Article #9039Which technique to apply not to slow down the service
From: Vladimir Stefanovic
Date: Fri, 06 Aug 2004 13:17
Date: Fri, 06 Aug 2004 13:17
55 lines
2378 bytes
2378 bytes
Hi,
I made a service which constantly monitors some ASCII
files for changes, and if it finds some matching pattern
in them - it makes internally some resend list...
ResendList->Add ( TELEPHONE1, MATCHED_STRING );
ResendList->Add ( TELEPHONE2, MATCHED_STRING );
ResendList->Add ( TELEPHONE3, MATCHED_STRING );
... which is intended to be passed (via TClientSocket/
TServerSocket) to another service which will send the
MATCHED_STRING from ResendList to specified mobile phones
(TELEPHONE1...) via SMS.
Sometimes it could be up to 100 items in the ResendList to
be passed at a time, to the (say) SMS_Service, and sometimes
can pass hours with no single item to be sent.
I want to avoid this /simplified/ ...
while ( !Terminated )
{
if ( FindPatterns() ) Pass_to_SMS_Service_via_sockets();
ServiceThread->ProcessRequests( false );
}
... because (I think) passing data through LAN in real life can
be a lengthy process in a manner of PC speed, so I want to
separate finding and passing.
I would like to do this /simplified/ ...
while ( !Terminated )
{
if ( FindPatterns() ) AddToResendList();
ServiceThread->ProcessRequests( false );
}
... and some other process to monitor my ResendList /simplified/:
while ( StillMoreItemsToBePassedFromResendList )
{
if ( PassCurrentItem() ) RemoveThisItemThatWasJustPassed();
}
Which technique can you suggest me to apply?
Best regards,
Vladimir Stefanovic
Technical Details
Message-ID:
<411384e2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b303ffe6ae15dbed,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <spam@not.needed> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Which technique to apply not to slow down the service Date: Fri, 6 Aug 2004 15:17:19 +0200 Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 213.137.116.177 Message-ID: <411384e2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1091798242 213.137.116.177 (6 Aug 2004 06:17:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail