Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Scheduling processes-threads and questions...: (6 Items)
   
Scheduling processes-threads and questions...  
Hi everybody,

*) I would like to create a number of processes(single threaded) and run them on a Neutrino x86 system using the FIFO 
scheduling, and measure the execution time of each process.


 I know that threads on Neutrino are scheduled globaly across all processes. I have study some of the documentetion 
about scheduling-algorithms at http://www.qnx.com/developers/docs/6.4.0/neutrino/sys_arch/kernel.html#SCHEDULING. I know

 that the FIFO or RR algorithm is only applied when 2 or more threads share the same priority and are in the READY state
.

1) Can i implement the * creating a number of programs (single-threaded) set the highest-priority to each thread-process
-
program and set scheduling-algorithm as FIFO ? Will this approach give me correct(with the mean of real) results for the

 processes execution time ? 

2) The other solution i thought is to create a new image of Neutrino where i haved enabled only the FIFO scheduling-
algorithm.Altering some files as nano_sched.c, ker_sched.c in the services/system/ker/ directory perhaps i can enable 
only the FIFO algorithm for all threads and processes. Then built all the source and create a new image. After booting 
the new image i can develope some processes and measure the execution times.

I imagine that the second approach is more difficult than the first, but i think it will give better results. What is 
your advice ? .
I have checked also the topic: http://community.qnx.com/sf/
discussion/do/listPosts/projects.core_os/discussion.newcode.topc1888

thanks in advance

Re: Scheduling processes-threads and questions...  
Andreas Polychronopoulos wrote:

> *) I would like to create a number of processes(single threaded) and run them on a Neutrino x86 system using the FIFO 

> scheduling, and measure the execution time of each process.

Is FIFO scheduling your objective, or your proposed method of getting execution times? If all you want is exections 
times, the most accurate way to do that is with an instrumented kernel and use the "System Profiler" view of Momementics
 
to analyse it after the fact.



> 2) The other solution i thought is to create a new image of Neutrino where i haved enabled only the FIFO scheduling-
> algorithm.Altering some files as nano_sched.c, ker_sched.c in the services/system/ker/ directory perhaps i can enable 

> only the FIFO algorithm for all threads and processes. 

Interesting. Let us know if that boots. FIFO scheduling is inherently dangerous. One tiny infinite-loop anywhere and the
 
whole system will hang.

-ad
Re: Scheduling processes-threads and questions...  
Yes FIFO scheduling is my objective but execution times also. So will the first approach give me any real results ? 

What exactly i want to do is to remove any scheduling policy neutrino supports (RR-Sporadic) and enable only the FIFO 
non-preemptive policy for all processes/threads. Then create a new image of qnx-neutrino and start some processes on the
 new image. Could you give me any hint to achieve this ? The scheduler files : nano_sched.c, ker_sched.c, nano_clock.c, 
kexterns.c are complicated and i think there is not a lot of documentation for this(not very well commented code at 
least for my level). If this attempt fails i will try the (1) i wrote on my first post, but i don't  think that i will 
take objective results.

thanks Atila

RE: Scheduling processes-threads and questions...  
I'm not sure any threads set their policy explicitly - it's all inherited (there may be exceptions).
 
You can just launch all processes in the boot image with fifo policy.
 
add [prio=10f]

________________________________

From: Andreas Polychronopoulos [mailto:community-noreply@qnx.com]
Sent: Fri 12/12/2008 6:38 PM
To: osmeta-core_os
Subject: Re: Scheduling processes-threads and questions...



Yes FIFO scheduling is my objective but execution times also. So will the first approach give me any real results ?

What exactly i want to do is to remove any scheduling policy neutrino supports (RR-Sporadic) and enable only the FIFO 
non-preemptive policy for all processes/threads. Then create a new image of qnx-neutrino and start some processes on the
 new image. Could you give me any hint to achieve this ? The scheduler files : nano_sched.c, ker_sched.c, nano_clock.c, 
kexterns.c are complicated and i think there is not a lot of documentation for this(not very well commented code at 
least for my level). If this attempt fails i will try the (1) i wrote on my first post, but i don't  think that i will 
take objective results.

thanks Atila



_______________________________________________
OSMeta
http://community.qnx.com/sf/go/post18566



Attachment: Text winmail.dat 4.14 KB
Re: RE: Scheduling processes-threads and questions...  
> I'm not sure any threads set their policy explicitly - it's all inherited (
> there may be exceptions).

In the documentation i read that there are some kernel calls (pthread_setschedparam()) which the threads can use to 
change the scheduling-policy and their priority. 
  
> You can just launch all processes in the boot image with fifo policy.
>  
> add [prio=10f]
> 

So i did as you said but when i run pidin after booting  there are a lot of processes with RR policy and FIFO also. I 
attach my build file with which i create the image (mkifs). I would appreciate if you chek out my build file. I create 
it from the Momentics 6.4.0 and just change the line [prio=10o] to [prio=10f].

thanks a lot



Attachment: Text test_qnxbase.mkifs 1.49 KB
Re: Scheduling processes-threads and questions...  
Yes, it looks like some threads do set their prio parameters, of course.

Andreas Polychronopoulos wrote:
>> I'm not sure any threads set their policy explicitly - it's all inherited (
>> there may be exceptions).
> 
> In the documentation i read that there are some kernel calls (pthread_setschedparam()) which the threads can use to 
change the scheduling-policy and their priority. 
>   
>> You can just launch all processes in the boot image with fifo policy.
>>  
>> add [prio=10f]
>>
> 
> So i did as you said but when i run pidin after booting  there are a lot of processes with RR policy and FIFO also. I 
attach my build file with which i create the image (mkifs). I would appreciate if you chek out my build file. I create 
it from the Momentics 6.4.0 and just change the line [prio=10o] to [prio=10f].
> 
> thanks a lot
> 
> 
> 
> 
> 
> _______________________________________________
> OSMeta
> http://community.qnx.com/sf/go/post18579

-- 
cburgess@qnx.com