Mladen Nikitovic wrote:
> Hi,
>
> I want to detect when a process (both user or kernel) terminates. The book 
> "Solaris Internals" points to functions exitlwps() and lwp_exit() but I'm 
> unsure whether all kinds of process/thread terminations will arrive at these 
> functions, or should I look into the general kernel exit() function?
>
> The general idea is that I want to measure the execution time of a process 
> among other processes in a multiprogrammed workload. I can detect when 
> task/process/thread is released but not terminated...which makes it hard to 
> measure execution time =)
>   

User threads can use either wait() (for processes) or
thr_join()/pthread_join() (for threads).  Normally in a multiprogrammed
environment this is how you would do it.  (Kernel threads are a bit
special, so I'm not 100% sure here.  But the new threading model is 1:1
so unless the threads are somehow created without user context (such as
a kernel taskq thread) it should be good enough for most uses.

I would look at the implementation of these functions to see if you can
figure out how to do it for kernel threads without any user context, if
you really need that.

    -- Garrett
> Best Regards,
> Mladen
>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
>   


-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to