On 9/22/05, raja <vnagaraju@xxxxxxxxxxxx> wrote: > > > i did like that. > here wht is the use of schedule() in this case? > Any way after the certain time thread2 is executed. > > Schedule() is used to give CPU to other tasks, as for( ; ; ) or while (1) is used in the thread then thread won't give CPU to any other process and thus system will hang ... So schedule() is actually giving the CPU to other tasks and telling to schedule the current thread for later execution ....... By the way you have to select/enable CONFIG_PREEMPT in kernel configuration which might able to show you the race condition or run/test on SMP system .... -- Fawad Lateef -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/