Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jun 2000 15:04:49 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        John Polstra <jdp@polstra.com>
Cc:        chris@calldei.com, hackers@FreeBSD.ORG
Subject:   Re: struct proc
Message-ID:  <200006262204.PAA30219@apollo.backplane.com>
References:  <3957ABBD.6010407@mail.ru> <20000626111453.E20702@holly.calldei.com> <200006262020.NAA16125@vashon.polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
:>    p is the process that made the syscall, curproc is the current
:> running process.  You should be using p for the process that
:> called my_syscall.
:
:Since only one process can enter the kernel at a time (currently),
:and p is the process that made the system call, it is also the
:current process.  I claim that (p == curproc) in this example, and
:that it would be better to code with p than with curproc.
:
:John
:  John Polstra                                               jdp@polstra.com
:...

    Even in an MP system, curproc is not going to be ripped out from
    under a syscall.  p will always be curproc.  (curproc in an MP
    system is a per-cpu variable).

    This whole p vs curproc thing is a huge mess.  95% of the time
    p == curproc.  The only places where it might not is in I/O ops
    that are completed by an interrupt or (in the case of NFS) some
    other process.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006262204.PAA30219>