This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
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".
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