Re: multithreaded device driver

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 22 May 2002 18:26:54 +0100 (BST)


> On 23 May 2002, lylai wrote:
> > Does linux kernel provide kernel level thread headers that I can use to
> > write a multithreaded device driver?
> >
> > Do I need to program a device driver to be multithreaded to achieve
> > paralle I/O?
> >
> > Thank you for your help.
>
> Worth looking at linux/drivers/net/8139too.c, that uses threads. Other
> methods of offloading work from a central point like an ISR could be done
> with Bottom Halves (tasklets) but that won't be parallelised.

Generally speaking you want to avoid threads for anything which is not
fantastically slow, polled and messy. Any normal code path wants to be in
the ISR handlers and when it has to deal with state coded properly as
state machines.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/