[osol-code] Quick question about thread blocking

2008-02-19 Thread micke
In OpenSolaris, when a real-time thread gets blocked it calls rt_yield(..) correct? or is there any other/more function that a thread "calls" when it gets blocked and put on a sleep queue? thanks This message posted from opensolaris.org ___ opensol

Re: [osol-code] priocntl syscall help, PC_SETPARMS

2008-01-23 Thread micke
> ***CODE*** > void *t_thread(void *p){ some work } > > rtparms_t rtp; > struct sched_param sp; > pthread_t t_1; > > //Setting some params to rtp; > > pthread_create(&t_1, NULL, t_thread, NULL); > sp.sched_priority = 100; > pthread_setschedparam(t_1, SCHED_FIFO, &sp); > //Want to have RT-class

[osol-code] priocntl syscall help, PC_SETPARMS

2008-01-21 Thread micke
***CODE*** void *t_thread(void *p){ some work } rtparms_t rtp; struct sched_param sp; pthread_t t_1; //Setting some params to rtp; pthread_create(&t_1, NULL, t_thread, NULL); sp.sched_priority = 100; pthread_setschedparam(t_1, SCHED_FIFO, &sp); //Want to have RT-class prio 100 //Then I want to

Re: [osol-code] Using the rtproc_t struct in disp.c, how to initialize memoy?

2008-01-14 Thread micke
Problem solved, did a redesign, put 99% of the code in rt.c only one line in disp.c, probably this way it should have been done since the beginning :) now it runs. :) This message posted from opensolaris.org ___ opensolaris-code mailing list opensol

[osol-code] Using the rtproc_t struct in disp.c, how to initialize memoy?

2008-01-13 Thread micke
Hi, as some of you know I'm working on extending the real-time class with the SCHED_SPORADIC policy and I'm almost done now, everything compiles the logic should be ok, BUT when I reboot with my new kernel it wont start up, it reboots after loading a bit. :/ So I search throw my code and find t

[osol-code] help needed, how to determine if a thread is a real-time thread??

2008-01-11 Thread micke
Hi, I'm changing some code in kernel-space, but I have a problem. In the dispatcher /usr/src/uts/common/disp/disp.c in the swtch() function I want to know if the current thread t is a real-time thread or not? How do I do this? Message was edited by: mikber-0 This message posted from

Re: [osol-code] compiling problem,what is wrong?

2008-01-01 Thread micke
Thanks I know, but the noghtly.log file is HUGE, is there some other way to tell what went wrong? Or what to look for in that file? This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mai

[osol-code] compiling problem,what is wrong?

2007-12-31 Thread micke
et `lx_brand' dmake: Warning: Target `lint' not remade because of errors dmake: Warning: Command failed for target `lib/brand/lx' dmake: Warning: Target `lint' not remade because of errors dmake: Warning: Target `lint' not remade because of errors Elapsed time of &#x

[osol-code] Determine if a thread is a real-time thread(kernel-space)?

2007-12-31 Thread micke
Hi, if I in kernel-space, modifying the scheduler/dispatcher, in the swtch() (in disp.c) function and I want to know if the current thread and/or the next thread belongs to the rt class? Is there some built in function for this like "is_this_thread_a_rt_thread(thread)" ? In Linux, kernel 2.6.23

Re: [osol-code] Howto add parameters to the kthread_t structure?

2007-12-12 Thread micke
Ahh, ok, hmm, sorry If I'm a little slow here, really appreciate the help. So If I get this right, I'm extending the rt class, so I shall add my parameters in the rtproc_t struct instead? And these parameters will be accessible via the cldata pointer for eatch rt thread? Then I can update this

Re: [osol-code] Howto add parameters to the kthread_t structure?

2007-12-12 Thread micke
Ok,thanks guys, hmm seems to be harder than I thougth. :( Thing I want to do is just add some parameters the the kthread_t struct, or I have already added them, I just need to set the initial values for them, these initial values will be different for every thread. I'm going to use theses param

[osol-code] Howto add parameters to the kthread_t structure?

2007-12-12 Thread micke
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_setschedpara

Re: [osol-code] How/where to add a parameter to a thread? Help needed. :(

2007-12-10 Thread micke
What I wrote in my first post, is it not visible?: Hi, I have extend the kthread_t structute in thread.h with a int flag; field. I have also extended the sched_param structure in sched.h with this flag: int flag; I want to set this flag via the sched_param structure, I also want it to be se

Re: [osol-code] How/where to add a parameter to a thread? Help needed. :(

2007-12-10 Thread micke
Anyone got any ideas? Or can I do this via some priocntl syscall? This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Re: [osol-code] Is there a "nightly make clean", problem compiling

2007-12-10 Thread micke
Hi, thanks, I tried to remove the N option, and now it compiles as it should.? This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

[osol-code] How/where to add a parameter to a thread? Help needed. :(

2007-12-09 Thread micke
Hi, I have extend the kthread_t structute in thread.h with a int flag; field. I have also extended the sched_param structure in sched.h with this flag: int flag; I want to set this flag via the sched_param structure, I also want it to be set to 0 when I create a new pthread. That is, in p

[osol-code] Is there a "nightly make clean", problem compiling

2007-12-09 Thread micke
Hi, I have a problem when I try to compile with nightly. I have compiled some times and it worked fined but now it started to compile "old files", that is I get a compile error in a file, I change it then I recompile, but I still get the same error at the same line, even thou I fixed it.?? It's

Re: [osol-code] Quick question, why can't I include sched.h in thread.h?

2007-12-07 Thread micke
Ok, thanks for the answers, just adding some parameters to the sched_param in sched.h and I want to use it in thread.h, but I've solved it now i think, I just copy the the parameters from sched_param to the thread structure when I create the thread. This message posted from opensolaris.org _

[osol-code] Quick question, why can't I include sched.h in thread.h?

2007-12-07 Thread micke
when I put this line in /usr/src/uts/commom/sys/thread.h #include located: /usr/src/head/sched.h I can't use what I want from sched.h? do I need to specify the path in some way when I include the file?? Message was edited by: mikber-0 This message posted from opensolaris.org

Re: [osol-code] priocntl syscall help. :(

2007-11-28 Thread micke
the program I want to run is: int main(void) { rtparms_t *p; long ret; ret = priocntl(P_LWPID, 0, PC_SETXPARMS, "RT", RT_KY_PRI, 10); printf("ret1: %d, errno %d\n", ret, errno); ret = priocntl(P_PID, 0, PC_GETXPARMS, "RT", RT_KY_PRI, p); printf("ret2: %d\n", ret); ret =

Re: [osol-code] priocntl syscall help. :(

2007-11-28 Thread micke
perror says: invalid argument, but is perror compatible with priocntl? errno is 22, can I get the errno msg? of do I have to check it manually? Not that home at error handling in c. :( I am root. This message posted from opensolaris.org ___ opensolar

[osol-code] priocntl syscall help. :(

2007-11-28 Thread micke
Hi, Im having a little problem using the priocntl syscall, I want to use the PC_SETXPARMS and PC_GETXPARMS as commands. >From the man page of priocntl I get it as I should use is it like this: [b]priocntl(P_PID, 0, PC_SETXPARMS, "RT", RT_KY_PRI, 10);[/b] If I want to change the class to real-t

Re: [osol-code] Getting ticks?

2007-11-19 Thread micke
Solved it: I just use gethrtime() it suits my needs. This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Re: [osol-code] howto, from another process, change a threads priority?

2007-11-16 Thread micke
> Hi Micke, > micke wrote: > > Hi, is this possible in Solaris? > > > > in user-space: > > > > process A is running, its job is to schedule > threads. > > > > process B is also running, making a new thread t1, > process B wants A to schedul

Re: [osol-code] What happens when a real-time thread wakes up?

2007-11-16 Thread micke
ok, thanks. This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

[osol-code] Getting ticks?

2007-11-16 Thread micke
Hi, is it possible to track execution time of a lwp in solaris? in kernel-space? For example if I'd like to add to the thread structure, fields like: -total execution time since start -total time sleeping etc ... I'd guess the best way of measuring this time would be in ticks, but how do I ge

[osol-code] What happens when a real-time thread wakes up?

2007-11-14 Thread micke
block) is it enough to place it in rt_wakeup() or do I need to place it in cv_signal(), cv_broadcast() and or cv_unsleep() also? thanks /Micke This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolari

Re: [osol-code] howto, from another process, change a threads priority?

2007-11-09 Thread micke
> micke wrote: > > FSS is not real-time ... > > So you are running the processes in the RT class then > ? I asked this > but you didn't answer. > > -- > Darren J Moffat That is correct, sorry that I missed to answer that. Everything runs in the real-time

Re: [osol-code] howto, from another process, change a threads priority?

2007-11-09 Thread micke
FSS is not real-time ... This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Re: [osol-code] howto, from another process, change a threads priority?

2007-11-08 Thread micke
> micke wrote: > > Hi, is this possible in Solaris? > > > > in user-space: > > > > process A is running, its job is to schedule > threads. > > In Solaris the kernel does thread scheduling. Why > are you trying to do > thread scheduling in a use

[osol-code] howto, from another process, change a threads priority?

2007-11-06 Thread micke
just be an int when I use pthread_self(), I get lets say 1. That make no sense for process A, since 1 is just the "local" thread id in process B. So how do I get to "global" thread id? and how to best send this to process A? Thanks /Micke This message posted

Re: [osol-code] How to pick out thread id?

2007-10-31 Thread micke
:) ok, but it wont work, not don't "standard stuff" so Any way just tried this: kthread_t *daemon; pcparms_t pcparms; rtparms_t *rtparmsp; id_t tid; int rt_id; rt_id = rt_class_id; pcparms.pc_cid = rt_id; rtparmsp = (struct rtparms *)pcparms.pc_clparms;

Re: [osol-code] How to pick out thread id?

2007-10-31 Thread micke
In linux if I use pthread_self() I get a pthread_t struct, that I have no access to anything in?? I don't know how to pick out the thread id from pthread_t in linux, that why I use the syscall. If anyone knows how, please let me know. In solaris it's "easier" pthread_t is a kthread_t and I can

Re: [osol-code] How to pick out thread id?

2007-10-31 Thread micke
I've tryed: kthread_t *t; pid_t tid; t = (kthread_t *)pthread_self(); tid = (pid_t)&t->t_tid; that works I think, the t_tid is the current threads id right? but the I want to change the scheduling class for this thread: sched_setscheduler(tid, SCHED_FIFO, &sp); This wont work, I get: : No su

[osol-code] How to pick out thread id?

2007-10-31 Thread micke
hi, in lunix I can do following: tid = syscall(SYS_gettid); to get the thread id of the current thread. How do I do this in solaris? This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://

Re: [osol-code] Where are the sleep Q(s)? / Where do a thread call when it gets block

2007-10-17 Thread micke
ion of the public documented interfaces available for the DTrace facility. And in the book "Solaris Dynamic Tracing Guide" I don't find any info about how to use dtrace from a application. Nor anything about the libdtrace library? Got any pointers for this? Thanks /Micke

Re: [osol-code] Where are the sleep Q(s)? / Where do a thread call when it gets block

2007-10-16 Thread micke
Hi, thanks, the DTRACE_SCHED(sleep) is exactly where I want to capture the time. Haven't had the time to read throw the dtrace book yet, but is it possible to extract this value? in kernel-space? also in user-space? This message posted from opensolaris.org

Re: [osol-code] Where are the sleep Q(s)? / Where do a thread call when it gets block

2007-10-15 Thread micke
Thanks for the answer, but thats in libc? The functionality I search for is in the kernel. Found this myself: http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/syscall/lwp_sobj.c The function lwp_block() have a sleepq_insert(&sqh->sq_queue, t); function that seems promi

[osol-code] Where are the sleep Q(s)? / Where do a thread call when it gets blocked?

2007-10-15 Thread micke
Hi, I'm in need of knowing exactly where in the code the sleep q(s) are implemented? That is, when a thread do a system call and gets blocked, where do this happen? What functions are call by the thread? I need to capture the time of this event ... This message posted from opensolaris.org _

Re: [osol-code] "main" scheduling function, real-time, FIFO and RR

2007-09-27 Thread micke
mented so to say ... hmm hope you understand what I mean. Any help is appreciated. Thanks. /Micke This message posted from opensolaris.org ___ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Re: [osol-code] "main" scheduling function, real-time, FIFO and RR

2007-09-26 Thread micke
ok, I know, already reading that book, great book btw. :) So the code for changing for ex sched_rr is all over then ... hmm ... ok, I'll keep browsing code n reading the book. more pointers are also welcome. ;) This message posted from opensolaris.org

[osol-code] "main" scheduling function, real-time, FIFO and RR

2007-09-26 Thread micke
Been looking throu the code for a while now but I can't seem to find where the "main" function for scheduling is. I'm interested in where the SCHD_FIFO and SCHED_RR in the real-time class are done. That is where is the time quantum for RR set/checked? where are threads picked from the real-time

[osol-code] Possible to ad a new scheduler to the OpenSolaris kernel?

2007-09-05 Thread micke
Is it possible Possible to ad a new scheduler to the OpenSolaris kernel? Anyone got some pointers to where I can get information? Im in need of implementing the POSIX SCHED_SPORADIC scheduler under Solaris. This message posted from opensolaris.org __