cvs commit: src/sys/kern kern_fork.c kern_proc.c src/sys/sys proc.h src/sys/vfs/procfs procfs_vnops.c
Matthew Dillon
dillon at apollo.backplane.com
Wed May 24 12:17:23 PDT 2006
:
:On Wed, May 24, 2006 at 11:59:51AM -0700, Matthew Dillon wrote:
:> Integrate pid generation for the new process into proc_add_allproc(), move
:> all related code from kern_fork.c to kern_proc.c.
:
:Can you make it a separate function instead? We might want to use a
:shared namespace for thread ids and process ids in the long run, I'm not
:sure yet. That would make it easier to deal with.
:
:Joerg
The allproc and zombproc lists are used to determine whether a pid is
in use or not. So the new pid generation has to be integrated with
adding the process to the allproc list to guarentee that a process with
a duplicate pid is not created.
The only reason we don't get duplicate pids now is that the whole mess
is serialized with the MP lock and its fairly difficult for nextpid to
cycle all the way around and select a duplicate pid before the previous
fork had a chance to add the new process to allproc. But it isn't really
isn't a good idea to depend on that behavior.
-Matt
Matthew Dillon
<dillon at xxxxxxxxxxxxx>
More information about the Commits
mailing list