Quote:
Originally Posted by ayyasprings
Hi sundialsvcs,
The article you mentioned does not answer me for the following questions.
1)Will the kernel process share the same scheduling policy and/or priority as of the one used for user space processes in the OS( I did not get cleared with the your explanation )? What part of the kernel source code handles this so that I could look on that and try to clarify myself?
|
Kernel threads are
"part of the kernel." As such, they aren't subject to "scheduling policies." If a kernel thread is ready to run,
it will run at once, pre-empting any user thread or process as necessary.
The kernel is responsible for creating and for maintaining the "user-land environment." It therefore cannot "wait on" that environment, or be subject, itself, to the scheduling that it provides.
The "kernel thread" analogy only exists for the kernel's convenience: to allow portions of the kernel to,
say, "start an I/O operation and
wait for it to complete," without introducing a
stinkin' wedge "special case" for kernel-initiated
vs. user-initiated "operations that need to 'wait.'"
(Full disclosure: I have worked on other operating systems that didn't have anything as truly-elegant as this ... and, ahhhhh, "it wasn't pretty." )
Quote:
2) Can multiple scheduling policies be used in the same embedded target in the same image used, like some group of processes use Scheduling policy X and another group of process use Scheduling policy Y like so and so?
|
You didn't Google very much, or you would have found
articles like this one. Or,
man 2 sched_setscheduler.
(And related: man 7 sched.) Yes, Linux has several scheduling policies that can be applied to tasks individually.
Quote:
3) What is/are the api or system call that will be used to initiate a user space task that can invoked from User Application code?
|
Try
man 2 fork
Quote:
4) how can I pass options like setting the type/name of Scheduling policy for that task, periodicity in which that task has to be invoked, time slice allocated for that task like so and so for user/kernel task ?
|
See
e.g. man 2 sched_setscheduler as noted above.
Quote:
I could not get answers for these from google.
|
You didn't
try very hard, did you?
Nevertheless, I am
pleased to try to help you – and so,
"hope this helps." But seriously, "you really
do need to
try harder get better at doing Internet research, because the Internet is fairly-stuffed with information related to these topics.