Skip navigation.
Home
The QNX Community Portal

View topic - regarding scheduling

regarding scheduling

For discussion of realtime and/or embedded programming.

regarding scheduling

Postby harasar » Fri Feb 11, 2011 8:18 am

I was interested in knowing if the scheduling for CPU time between multiple processes was the same as the scheduling for CPU time between multiple threads of the same process.

To be more precise, if there are p processes running, each running t number of threads, when the scheduler decides which thread gets the CPU next does it take into consideration that another thread from the same process just had the CPU? i.e, does the scheduler try to give preferences to threads from processes that didn't recently get the CPU.

Round-robin , FIFO etc all scheduling algo s are for threads or process
as there are no priority option for processes

if this is a silly qn.. please forgive me :(
Thanks in advance
harasar
New Member
 
Posts: 6
Joined: Wed Jul 09, 2008 1:03 pm

RE: regarding scheduling

Postby Thunderblade » Fri Feb 11, 2011 8:55 am

The scheduler doesn't know about processes, only about threads.
Thunderblade
Senior Member
 
Posts: 487
Joined: Thu Apr 07, 2005 11:52 am

RE: regarding scheduling

Postby qnxloader » Fri Feb 11, 2011 9:01 am

process is container for threads.
there is no process without threads(process is at least have one thread), so no priority for process.
so scheduling for processes is same as scheduling threads for all processes in system.
qnxloader
Senior Member
 
Posts: 206
Joined: Mon Oct 06, 2003 8:29 am

RE: regarding scheduling

Postby harasar » Fri Feb 11, 2011 9:13 am

ok....

if we read this line from wiki ( or from anywhere)

Round-robin (RR) is one of the simplest scheduling algorithms for processes in an operating system,

so i thought that schedular deals with process.

so it means that there is no role of process for schedular? is it not strange?

if schedular knows about process also then might be less context switching is required..
harasar
New Member
 
Posts: 6
Joined: Wed Jul 09, 2008 1:03 pm

RE: regarding scheduling

Postby mario » Fri Feb 11, 2011 4:05 pm

As far as I know there is no preferences given to the next thread being in the same process as the current thread or not. There is no mention of that in the documentation. However when switching from threads in the same processes the kernel used a different code path (faster) then when switching from threads that are not in the same process.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: regarding scheduling

Postby maschoen » Sat Feb 12, 2011 8:04 pm

There are some operating systems for which there is a hierarchy for scheduling. The scheduler would first check for the highest priority process, and then schedule based on the thread priority within that process. I don't think that makes much sense for a real time system like QNX. What if I process had two threads, one which needs to run at a higher priority than any other application thread, and one which should run lower than any other application thread? You could not do it without splitting the two threads into two processes. But this type of division of labor is not uncommon for QNX.

Consider this Koan for a second. If a (QNX) system is using round-robin scheduling, and it is working the way round-robin is defined, then it is probably not working.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

RE: regarding scheduling

Postby harasar » Mon Feb 14, 2011 4:06 am

thanks to all :)
harasar
New Member
 
Posts: 6
Joined: Wed Jul 09, 2008 1:03 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 1 guest