On Wed, 12 Dec 2007, micke wrote: > Hi, I don't know if my last post is visible or not, seems like people can't > see it? Anyway > > > If I want to extend the kthread_t structure with some parameter like a flag, > how do I do this? > > I want to do this via the sched_param structure, when I use > pthread_createthread() and pthread_setschedparam() > > That is, I extend kthread_t vith for ex: "int flag" and I also extend > sched_param with "int flag" Then when I create a new thread I want to set it > to 1. And via pthread_setscheduler() I want to change it to some other value. > > How do I accomplish this?
There are _TWO_ thread structures (one for userland and one for kernel) and you seem to think there's only one ? "curthread" is not defined in userland, and neither is kthread_t; hence, the only way to modify a member of the kernel thread structure is to perform a system call of sorts. Defining your own syscall ... hmm. But then ... that seems wrong. The mechanism to "add" parameters to the kernel thread structure that behave such as the one you're talking about would be to write your own scheduling class module, and perform the initializations/modifications of that schedclass-specific state from *_enterclass(), *_parmsset(). FrankH. > > > This message posted from opensolaris.org > _______________________________________________ > opensolaris-code mailing list > [email protected] > http://mail.opensolaris.org/mailman/listinfo/opensolaris-code > ------------------------------------------------------------------------------ No good can come from selling your freedom, not for all the gold in the world, for the value of this heavenly gift far exceeds that of any fortune on earth. ------------------------------------------------------------------------------ _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
