[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
RE: Schedule in task_queues works ?
Before calling schedule , state of task should be changed either to
Interruptible or Non interruptible...
But in my example i am not changing the state ..I think it still is in
running state....Any way it will be put in ready queue.But i don't
know y it not getting chance to run......
On Thu, 25 May 2000, you wrote:
> > I have one interesting doubt
> > > Please have a look at small piece of code
> > >
> > > void print()
> > > {
> > > printk("The current process %s\n",current->comm);
> > > schedule();
> > > printk(" The current process %s\n",current->comm);
> > > }
> > >
> >
> > I'm not sure that you're allowed to use the task queue that way.
> > The purpose of the task queue is what they call "software interrupt
> > handling". When you get a hardware interrupt, you don't want to spend
> > time blocking other irqs, so you queue the work and unmask interrupts.
> >
> > At other points in time (return from syscall, interrupt, ctx
> > switch etc), the
> > task queue is checked and executed. I think calling schedule,
> > when you're
> > in the task queue, will somehow mark the process ineligible
> > for scheduling.
>
> Calling schedule will just call the scheduler and maybe some other process
> which is the first in the run queue will get the timeslice.
> You call schedule only when you know that you do not want to use the
> remaining portion of your time slice. Something similar to pthread_yield()
> in the user mode :)
>
>
> -----------------------------------------------------------------------
> LIP is all for free speech. But it was created for a purpose - to help
> people discuss technical programming related issues about Linux. If
> your messages are counterproductive to this purpose, your privileges to
> submit messages can and will be revoked.
--
*****************************************
Praveen.M
Software Engineer
Emdedded System
Rendezvous On Chip.
Secunderabad.
Email : praveenb@xxxxxxxxx
*****************************************