Re: PThreads in kernel module & network interface

Bart Trojanowski (bart@jukie.net)
Wed, 4 Apr 2001 08:18:22 -0400 (EDT)


On Wed, 4 Apr 2001, Remko van der Vossen wrote:
> second problem is that when I use the PThread functions from this module I
> need the pthread library. As you probably know gcc doesn't link the pthread
> library into the module, so I tried to do that with ld, that in itself
> worked, I successfully linked the pthread library into the module I made,

The first problem you are running into is mixing user space with kernel
code. You cannot use pthreads in the kernel... not directly anyways. You
could use kernel_thread() instead.

If your future stack will have a BSD socket interface you could prototype
your server in user space - and use pthreads. If you don't want the
interface then you can hook into the stack directly by using the sock_*
functions (see include/linux/net.h). You will probably get everything you
need to start you off from an article by Alessandro Rubini at the Linux
Magazine: http://www.linux-mag.com/2000-12/gear_01.html

> Thank you in advance,

Cheers,
Bart.

-- 
	WebSig: http://www.jukie.net/~bart/sig/

- 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/