Hi Garrett, Thank you for the quick response. The reason I need to kernelise the network application as it needs to process 1.3/1.4 millions packet per second. Do you think using the taskqueue api has any impact on the performance? In FreeBSD, we are hitting around 80% cpu usage.
Also my function for the network applications takes a mbuf* parameter and processes it. However, if I call ddi_taskq_dispatch for each incoming packet (mbuf), that will require quite a large pool. Will the task pool get exhausted? Alternatively, should I make the function as an infinite loop instead and pass on to taskq_dispatch only once, then relying on taskq_resume/suspend when packet is ready. Would this be better? Many thanks Joe On 14 Jul 2008, at 21:43, Garrett D'Amore wrote: > I'd try first to use a taskq -- ddi_taskq_create(9F) -- they are > documented, and should be stable. > > -- Garrett > > Joe Kuan wrote: >> Hi all, >> >> I have managed to kernelised our network application into FreeBSD >> and worked very well. Now, I start the same process on OpenSolaris. >> Although I have got the Solaris Internal book with me, it really >> explains how everything works together. What I need is some tutorial >> or example on how to use kernel functions >> >> On FreeBSD, I can do something like >> >> SYSINIT(foo, ..); >> >> void foo(void *bar) { >> >> ..... >> kthread_create(my_func, ....); >> } >> >> >> void my_func(void *arg) { >> >> while (1) { >> >> do something >> >> sleep until timeout or wakeup by another signal >> } >> } >> >> where SYSINIT is to dispatch kernel thread at startup >> >> Here is the link of man page of kthread_create, >> http://www.FreeBSD.org/cgi/man.cgi?query=kthread_create&apropos=0&sektion=0&manpath=FreeBSD+6.3-stable&format=html >> >> Here is the link of the info and showing how to use SYSINIT, >> http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/sysinit.html >> >> I would be appreciate if anyone can point me to any document/source >> file/man pages/anything on the usage of creating a kernel thread >> using >> thread_create and also the equivalent mechanism of SYSINIT in >> OpenSolaris. >> >> Many many thanks in advance. >> Joe >> _______________________________________________ >> opensolaris-code mailing list >> opensolaris-code@opensolaris.org >> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code >> > _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code