Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Apr 2012 10:57:23 +0100
From:      "'Chris Hall'" <chris.hall.list@highwayman.com>
To:        <freebsd-threads@freebsd.org>
Subject:   pthread_getcpuclockid() not quite what I expected
Message-ID:  <03d901cd1e12$d4720820$7d561860$@highwayman.com>

next in thread | raw e-mail | index | archive | help
I use pthread_getcpuclockid() in a "watch-dog" pthread to one side of
a pthreaded application.

With FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012 the result
is a little disappointing.  The clock_id returned is the same for all
thread_ids, and is CLOCK_THREAD_CPUTIME_ID.  So, instead of reading
the cpu time for each pthread, clock_gettime() in the watch-dog
pthread reads its own cpu time :-(

This is not quite what POSIX lead me to hope for.

Is there something more modern I should be using ?

Chris
-- 
Chris Hall,  Highwayman





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?03d901cd1e12$d4720820$7d561860$>