Re: detecting process termination in kernel?
Re: detecting process termination in kernel?
- Subject: Re: detecting process termination in kernel?
- From: Rick Macklem <email@hidden>
- Date: Wed, 2 Apr 2008 10:47:21 -0400 (EDT)
On Tue, 1 Apr 2008, Terry Lambert wrote:
[good stuff snipped]
Also, proc_find() can return false positives, so you will not want to poll
either; there are a finite number of PIDs available, and eventually they get
recycled. If you are trying to do something by PID, then you are probably
Good point. It works ok for my case because all I want to do is some
garbarge collection cleanup after the process is gone, so false positives
simply delay that. I just create a kernel thread that loops around,
sleeping for a fraction of a second and then does proc_find(), so the
false positive won't occur unless the system is creating lots'a'processes
anyhow. Obviously not necessarily the case for other Kexts.
For the process related stuff (something NFSv4 calls OpenOwners), I also
keep track of the process's creation time, so that recycled pids don't
cause grief. (I seem to recall getting the process's creation time isn't
a kpi call, so it is one of the places my Kext has to "cheat". It's an
open source experimental project, so I'm confortable with that.)
rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden