Article View: borland.public.jbuilder.java.api
Article #1464How to free some processor resources ?
From: Laurent Souriau
Date: Thu, 13 Dec 2001 11:30
Date: Thu, 13 Dec 2001 11:30
63 lines
3202 bytes
3202 bytes
Hi,
I wrote a Java application that reads messages received from a server.
these messages are read via a thread that loops and rests itself
every 5 ms after having read a message.
My problem is that I have no more processor resource !
I can't have access to my GUI, everything is frozen. I have to wait
to have received all the messages to be able to do something on my GUI.
Any idea is welcome
Laurent
email : lsouriau@club-internet.fr
Here is my thread code :
-*********************************************
public void FluxGetMess()
{
//Cr๏ฟฝation d'une Thread qui poole les messages
Thread tPool = new Thread()
{
public void run()
{
D_FLUX pool;
while (isPooling)
{
pool = null;
pool = EasyIHM.comm.FluxReceive(handleBuffer);
if (pool != null)
{
processMessage(pool);
try
{
sleep(5);
} catch (java.lang.InterruptedException e)
{
System.out.println("Error during Pooling");
e.printStackTrace();
}
}
else
{
try
{
Thread.sleep(poolingFrequence);
} catch (java.lang.InterruptedException e)
{
System.out.println("Error during Pooling");
e.printStackTrace();
}
}
} // Fin while
} // Fin run()
};
tPool.start();
}
*******************************************************
Technical Details
Message-ID:
<9va3a9$ir4$1@s1.read.news.oleane.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!oleane.net!oleane!nnrp.oleane.net!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10a146,bf9a4fab23a9c2ee,start X-Google-Attributes: gid10a146,public X-Google-Thread: 1089d0,bf9a4fab23a9c2ee,start X-Google-Attributes: gid1089d0,public X-Google-Thread: f74b3,bf9a4fab23a9c2ee,start X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-12-13 03:30:04 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Laurent Souriau" <lsouriau@club-internet.fr> Newsgroups: borland.public.jbuilder.java.api,borland.public.jbuilder.java.language,comp.lang.java.programmer Subject: How to free some processor resources ? Date: Thu, 13 Dec 2001 12:30:02 +0100 Organization: Guest of France Telecom Oleane's newsreading service Lines: 66 Message-ID: <9va3a9$ir4$1@s1.read.news.oleane.net> NNTP-Posting-Host: aqsacom.rain.fr X-Trace: s1.read.news.oleane.net 1008242825 19300 195.6.24.78 (13 Dec 2001 11:27:05 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 13 Dec 2001 11:27:05 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400