Date: Thu, 12 Jan 2006 03:19:05 -0800 (PST) From: kamal kc <kamal_ckk@yahoo.com> To: freebsd <freebsd-hackers@freebsd.org> Subject: Re: rescheduling tasks using swi_add() Message-ID: <20060112111905.85809.qmail@web30006.mail.mud.yahoo.com> In-Reply-To: <20060111164559.5714.qmail@web30009.mail.mud.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--- kamal kc <kamal_ckk@yahoo.com> wrote:
> >
> > Queue a task to a taskqueue. Behind the scenes
> that
> > will invoke a swi_add if
> > you use the taskqueue_swi queue. However, given
> > that you want to do some
> > rather complicated work, you'd be better off
> > creating a dedicated taskqueue
> > thread and queueing tasks off to it I think.
> >
>
> thanks for the suggestion on the taskqueue. i tried
> it
>
> on my dummy kernel module and got some output but i
> am not sure if i followed the correct steps to
> use the taskqueue. the only thing i found
> was the man pages and the taskqueue.h.
>
> here is the code:
> -----------------------
>
> struct taskqueue_arguments
> { int a;
> int b;
> };
>
> void taskqueue_function(void *,int);
> typedef void taskqueue_function_t(void *,int);
>
> /* taskqueue function */
> void taskqueue_function(void *arguments,int int_arg)
> {
> struct taskqueue_arguments *arg;
> arg=(struct taskqueue_arguments *)arguments;
> printf("\ntakqueue_function was called the args
> are %d %d",arg->a,arg->b);
> return;
> }
>
> /* function implementing the syscall */
> static int
> hello(struct thread *td, void *arg)
> { .........
> struct task mytask;
> taskqueue_function_t *taskqueue_function_ptr;
> taskqueue_function_ptr=taskqueue_function;
>
> struct taskqueue_arguments arg_var;
> arg_var.a=10;
> arg_var.b=20;
>
>
>
TASK_INIT(&mytask,50,taskqueue_function_ptr,&arg_var);
> taskqueue_enqueue(taskqueue_swi, &mytask);
>
> ...........
> }
>
dear all ,
i run the above code and the kernel
would crash whenever i would do the syscall for few
number of times. the crashing process is
(swi6: task queue). the kernel crashes very soon
when i make the system call in a loop.
i guess i didn't follow all the steps to use
the taskqueue ....
i think some of you can help what did i
miss ....
thanks,
kamal
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060112111905.85809.qmail>
