Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Priority of worker threads.
Priority of worker threads. [message #459800] Wed, 17 August 2005 12:19 Go to next message
Johan Tibell is currently offline Johan TibellFriend
Messages: 14
Registered: July 2009
Junior Member
Is it a good idea to create your worker threads with a lower priority
than that of the UI thread to get a more responsive UI. I think that's
what you are supposed to do in Swing (with UI thread priority 6) at least.
Re: Priority of worker threads. [message #459844 is a reply to message #459800] Thu, 18 August 2005 02:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nil.null.void

Don't tweak the thread priorities unless you find a very good reason to do
do---let the subsystem handle it for you. You should bare in mind that the
UI thread is typically idle most of its time anyway, so all of your efforts
might be doomed to be pointless and in vane anyways.

Ph.
Re: Priority of worker threads. [message #459846 is a reply to message #459844] Thu, 18 August 2005 07:30 Go to previous messageGo to next message
Michael Forster is currently offline Michael ForsterFriend
Messages: 4
Registered: July 2009
Junior Member
Philip Köster wrote:
> Don't tweak the thread priorities unless you find a very good reason to do
> do---let the subsystem handle it for you. You should bare in mind that the
> UI thread is typically idle most of its time anyway, so all of your efforts
> might be doomed to be pointless and in vane anyways.

I think this is a case of a good reason:

http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#1

MIke
Re: Priority of worker threads. [message #459849 is a reply to message #459846] Thu, 18 August 2005 10:22 Go to previous messageGo to next message
Johan Tibell is currently offline Johan TibellFriend
Messages: 14
Registered: July 2009
Junior Member
Michael Forster wrote:
>
> I think this is a case of a good reason:
>
> http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#1
>
> MIke

This was what I had in mind. The java.util.concurrent package creates
threads with lower priority than Swing's UI thread (i.e. 5) but since we
(by using SWT) run our own UI thread with priority 5 instead of 6 we get
the problems associated with inheriting the UI thread's priority anyway.

- Johan
Re: Priority of worker threads. [message #459857 is a reply to message #459849] Thu, 18 August 2005 14:43 Go to previous messageGo to next message
John Arthorne is currently offline John ArthorneFriend
Messages: 176
Registered: July 2009
Senior Member
Although SWT doesn't do this, the Eclipse workbench does increase the UI
thread's priority by one (see Workbench.createDisplay). So, if you're
writing a plugin to the Eclipse platform, you can follow the convention
of setting your background threads to NORM_PRIORITY. The Eclipse jobs
API (org.eclipse.core.runtime.jobs) does this for all worker threads it
creates.
--

Johan Tibell wrote:
> Michael Forster wrote:
>
>>
>> I think this is a case of a good reason:
>>
>> http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#1
>>
>> MIke
>
>
> This was what I had in mind. The java.util.concurrent package creates
> threads with lower priority than Swing's UI thread (i.e. 5) but since we
> (by using SWT) run our own UI thread with priority 5 instead of 6 we get
> the problems associated with inheriting the UI thread's priority anyway.
>
> - Johan
Re: Priority of worker threads. [message #459859 is a reply to message #459857] Thu, 18 August 2005 15:21 Go to previous message
Johan Tibell is currently offline Johan TibellFriend
Messages: 14
Registered: July 2009
Junior Member
John Arthorne wrote:
> Although SWT doesn't do this, the Eclipse workbench does increase the UI
> thread's priority by one (see Workbench.createDisplay). So, if you're
> writing a plugin to the Eclipse platform, you can follow the convention
> of setting your background threads to NORM_PRIORITY. The Eclipse jobs
> API (org.eclipse.core.runtime.jobs) does this for all worker threads it
> creates.
> --

Thanks. That's all I needed to know.

- Johan
Previous Topic:Browser and BusyIndicator
Next Topic:SWT Browser: LocationListener.changing() and the BeforeNavigate event
Goto Forum:
  


Current Time: Thu Apr 25 01:51:38 GMT 2024

Powered by FUDForum. Page generated in 0.02761 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top