DragonFly BSD
DragonFly commits List (threaded) for 2006-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/kern kern_fork.c kern_proc.c src/sys/sys proc.h src/sys/vfs/procfs procfs_vnops.c


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 May 2006 12:16:50 -0700 (PDT)

:
: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@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]