Re: flush_scheduled_tasks() question

David Woodhouse (dwmw2@infradead.org)
Mon, 29 Jan 2001 09:53:56 +0000


manfred@colorfullife.com said:
> Is is intentional that tummy_task is not initialized?

It _is_ initialised. To zero :)

> Ok, it won't crash because the current __run_task_queue()
> implementation doesn't call tq->routine if it's NULL, but IMHO it's
> ugly.

-static struct tq_struct dummy_task;
+static struct tq_struct dummy_task /* = all zero */;

manfred@colorfullife.com said:
> Additionally I don't like the loop in flush_scheduled_tasks(), what
> about replacing it with a locked semaphore (same idea as vfork)?

The reason for doing it that way was because there was no guarantee that
scheduled tasks will be called in order. So you can't just stick a new task
in the queue and assume that when it's completed the queue is flushed.

Linus then changed that and made the eventd thread call tasks in order, but
I believe the intention is still that we don't make that guarantee, so it
may change at any point in the future.

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/