[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

[LI] scheduling in Linux



Hi,

   I have a multithreaded application. In one of the threads, I'm required
to do something at particular intervals of a 45 kHz clock. I simulate the
45kHz clock from the system clock (the gettimeofday system call gives the
system time in 1MHz resolution). My problem is that the thread gets
swapped out, so sometimes the time difference between 2 gettimeofday calls
is greatly different. I have these doubts. 


If I increase the priority of the concerned thread, using the
sched_setscheduler system call, will it require me to change the
scheduling policies of the other threads also? - in other words, is it
possible for me to have just one thread in the application to have a real
time scheduling policy, and others at default scheduling policy? Will my
other threads get scheduled?

I've also seen some programs using sleep(0). What does sleep(0) mean? Does
it just relinquish processor time? Does the nanosleep system call also
relinquish processor time?  

It'll be very helpful if someone could explain.

TIA,
with warm regards,
PS

--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.