Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Garbage collection thread belongs to which priority..min?normal?max?
What is meant by time slicing?
 
girish rateshwar
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Prashant Neginahal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic