This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [RFC] Posix compliant behavior ofCLOCK_PROCESS/THREAD_CPUTIME_ID
- From: Enrique Perez-Terron <enrique dot perez-terron at norway dot online dot no>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 28 Sep 2004 23:52:19 +0200
- Subject: Re: [RFC] Posix compliant behavior ofCLOCK_PROCESS/THREAD_CPUTIME_ID
- References: <B6E8046E1E28D34EB815A11AC8CA312902CD3264@mtv-atc-605e--n.corp.sgi.com> <Pine.LNX.4.58.0409240508560.5706@schroedinger.engr.sgi.com> <4154F349.1090408@redhat.com> <Pine.LNX.4.58.0409242253080.13099@schroedinger.engr.sgi.com> <41550B77.1070604@redhat.com> <B6E8046E1E28D34EB815A11AC8CA312902CD327E@mtv-atc-605e--n.corp.sgi.com> <Pine.LNX.4.58.0409271344220.32308@schroedinger.engr.sgi.com>
On Mon, 2004-09-27 at 22:58, Christoph Lameter wrote:
> Attached follows a patch to implement the POSIX clocks according to the
> POSIX standard which states in V3 of the Single Unix Specification:
[snip]
> + struct task *t;
> +
> + /* Add up the cpu time for all the threads of this process */
> + for (t = current; t != current; t = next_thread(p)) {
This is a NOOP.
The usual idiom to process all threads of 'current''s thread group is
t = current;
do {
something();
t = next_thread(t);
} while (t != current);
The related idiom
for (t = next_thread(current); t != current; t = next_thread(t))
{...}
processes all threads in the thread group other than 'current' itself.
-Enrique