🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1465

Re: How to free some processor resources ?

#1465
From: Fredrik
Date: Thu, 13 Dec 2001 11:46
26 lines
2068 bytes
"Laurent Souriau" <lsouriau@club-internet.fr> wrote in message
news:9va3a9$ir4$1@s1.read.news.oleane.net...
>         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
*snip*

I guess the problem lies with this line of code:
        processMessage(pool);

If this one updates the GUI in any way, that means (up to) 200 updates per
second! If the update is anything but trivial, it means having to repaint a
lot
200 times per second, and that is costly indeed. See what happens when you
increase the sleep time to, say, 50 or 100 msecs...

/F
Technical Details
Message-ID: <9va34a$2a5$1@newstoo.ericsson.se>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-ge.switch.ch!luth.se!erix.ericsson.se!erinews.ericsson.se!newstoo.ericsson.se!not-for-mail
References: <9va3a9$ir4$1@s1.read.news.oleane.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10a146,bf9a4fab23a9c2ee
X-Google-Attributes: gid10a146,public
X-Google-Thread: 1089d0,bf9a4fab23a9c2ee
X-Google-Attributes: gid1089d0,public
X-Google-Thread: f74b3,bf9a4fab23a9c2ee
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-12-13 03:46:30 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-ge.switch.ch!luth.se!erix.ericsson.se!erinews.ericsson.se!newstoo.ericsson.se!not-for-mail
From: "Fredrik" <fredrik_lannergren@yahoo.com>
Newsgroups: borland.public.jbuilder.java.api,borland.public.jbuilder.java.language,comp.lang.java.programmer
Subject: Re: How to free some processor resources ?
Date: Thu, 13 Dec 2001 12:46:14 +0100
Organization: ericsson
Lines: 28
Message-ID: <9va34a$2a5$1@newstoo.ericsson.se>
References: <9va3a9$ir4$1@s1.read.news.oleane.net>
NNTP-Posting-Host: sl121133.ki.sw.ericsson.se
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200