lecture-38 - Thread Priorities Thread priorities are used...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 38 Thread Priorities Thread Priorities Thread priorities are used by the thread scheduler to decide when each thread should be allowed to run. Higher-priority threads get more CPU time than lower-priority threads – amount of cpu time a thread gets often depends on operating systems, for example.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 39 Thread Priorities Thread Priorities The method setPriority() , a member of Thread , is used to set a thread’s priority: final void setPriority(int level) level specifies the priority setting for the calling thread – level ranges between MIN_PRIORITY (1) and MAX_PRIORITY (10) To make a thread back to default priority, specify NORM_PRIORITY (5) To obtain the current priority setting of a thread: final int getPriority();
Background image of page 2
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 40
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 41 About About volatile volatile http://www.javaperformancetuning.com/news/qotm030.shtml
Background image of page 4
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 42
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
OOP Java - Multithreaded Programming R.B. Lenin Winter - 2006 DA-IICT 43
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/15/2010 for the course CSE IT115 taught by Professor Rblenin during the Spring '10 term at Punjab Engineering College.

Page1 / 20

lecture-38 - Thread Priorities Thread priorities are used...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online