Re: A question about runqueue
From: Chen Bin (sunwen_ling_at_tom.com)
Date: 11/17/03
- Next message: Brandon Niemczyk: "Re: Linux pthreads and pthread_rwlock* calls"
- Previous message: Randall Hyde: "Raw Disk I/O under Linux"
- In reply to: Kasper Dupont: "Re: A question about runqueue"
- Next in thread: Kasper Dupont: "Re: A question about runqueue"
- Reply: Kasper Dupont: "Re: A question about runqueue"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 16 Nov 2003 15:56:10 -0800
Kasper Dupont <kasperd@daimi.au.dk> wrote in message news:<3FB75672.83AF2531@daimi.au.dk>...
> Chen Bin wrote:
> >
> > HI,
> >
> > I notice that in arch/i386/kernel/semaphore.c,if a task is going to be
> > blocked,its state is changed BUT not dequeued from the per cpu's
> > runqueue.But when it is waken up,the activate_task actually enqueue to
> > the runqueue,is it right?
>
> I think the dequeueing is done by this piece of code from
> schedule() in kernel/sched.c:
>
> switch (prev->state) {
> case TASK_INTERRUPTIBLE:
> if (unlikely(signal_pending(prev))) {
> prev->state = TASK_RUNNING;
> break;
> }
> default:
> deactivate_task(prev, rq);
> case TASK_RUNNING:
> ;
> }
>
> Also AFAIR the enqueueing code actually checks if it is
> on the list before inserting it.
Thank you very much.
I want to know if I don't use a waitqueue,how can I destroy the whole
waitqueue after I have called DECLEAR_WAIT_QUEUE_HEAD to establish a
new queue?
Thanks in advance.
Chen Bin
- Next message: Brandon Niemczyk: "Re: Linux pthreads and pthread_rwlock* calls"
- Previous message: Randall Hyde: "Raw Disk I/O under Linux"
- In reply to: Kasper Dupont: "Re: A question about runqueue"
- Next in thread: Kasper Dupont: "Re: A question about runqueue"
- Reply: Kasper Dupont: "Re: A question about runqueue"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]