File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Garbage collection thread belongs to which priority..min?normal?max? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Garbage collection thread belongs to which priority..min?normal?max?" Watch "Garbage collection thread belongs to which priority..min?normal?max?" New topic
Author

Garbage collection thread belongs to which priority..min?normal?max?

senthil sen
Ranch Hand

Joined: Oct 10, 2002
Posts: 184
Garbage collection thread belongs to which priority..min?normal?max?
What is meant by time slicing?
girish rateshwar
Ranch Hand

Joined: Mar 04, 2001
Posts: 97
Hi,
Garbage collection runs as a LOW priority thread.
well whenever a object ceases to exist or an explicit declaration 'obj=null',this object is ONLY marked for GC, but u really never have control as to when it would release the memory in the pool.

Time slicing:In a multithreaded program,n number of threads may b running concurrently.To enable execution of these threads ,the processor divides its time into slices and assigns these time-slices to the processes. It runs a process(a thread) for few milliseconds, saves its state and switches to the next process, runs it for few milliseconds, saves it state and switches to next and so on.
This can also be termed as "context switching".


Girish
Prashant Neginahal
Ranch Hand

Joined: Dec 04, 2002
Posts: 76
Hi senthil sen,
Garbage collector is a low(min) priority thread that runs behind the screen.
About time slicing , its same as round robin implementation.The OS thread schedular allocates some defined time for each thread to consume CPU cycles and it keeps rotating between threads.
Basically there two implementations for thread schedular ,
1)Preemptive Scheduling
2)Time Slicing.
In First case , heigher priority threads gets full access over processor.In second case, each thread gets chance to get executed.
hope i answered ur question.

----------------------
Sharing is better way of learing..
Prashant


--------------<br />Prashant<br />SCJP-91%
 
Don't get me started about those stupid light bulbs.
 
subject: Garbage collection thread belongs to which priority..min?normal?max?
 
Similar Threads
Daemon threads & non daemon Threads
Thread
threads
Thread.NORM_PRIORITY, not the default thread priority???
here are some interview questions asked?any one kindly reply to these quesitons??