Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!umd5!cogsci!wjb From: wjb@cogsci.cog.jhu.edu Newsgroups: comp.benchmarks Subject: Re: Which benchmarks are useless? Message-ID: <02.May.91.132611.54@cogsci.cog.jhu.edu> Date: 2 May 91 17:26:11 GMT References: <2502@spim.mips.COM> <21720006@hpfcso.FC.HP.COM> Organization: JHU Cognitive Science Center, Baltimore, MD Lines: 20 In article <21720006@hpfcso.FC.HP.COM> jvm@hpfcso.FC.HP.COM (Jack McClurg) writes: >patrick@convex.COM (Patrick F. McGehearty) / 4:51 pm Apr 29, 1991 / wrote: >> [benchmarks and caching of process id for getpid() calls] > >[disavows any such caching in HPUX] I've heard this "rumor" as well. I always wondered why people didn't try to test it out by comparing getpid() and getppid() times. Your PID may not ever change, but your PPID will change to 1 if your parent exits. This would appear to require that getppid() enter the kernel. Actually, the real way to speed up both of these system calls is to map a page of memory read-only into the data space of the process and have the program read this data directly from where the kernel stores it. I guess this is another example of the dangers of micro benchmarks and making assumptions about how different system functions are implemented. Bill Bogstad