http://groups.google.com/group/comp.programming.threads?hl=en
comp.programming.threads@googlegroups.com
Today's topics:
* How to implement thread specific timer in a multi-threaded program - 2
messages, 2 authors
http://groups.google.com/group/comp.programming.threads/t/322963722476d567?hl=en
==============================================================================
TOPIC: How to implement thread specific timer in a multi-threaded program
http://groups.google.com/group/comp.programming.threads/t/322963722476d567?hl=en
==============================================================================
== 1 of 2 ==
Date: Wed, Sep 30 2009 8:21 am
From: Chris Friesen
On 09/30/2009 08:55 AM, David Schwartz wrote:
> Okay, let's start with a simple question -- why would anyone want a
> thread-specific timer? What possible function could it serve? Whatever
> it is that you want to impose a timeout on, why associate the timer
> with a thread?
>
> It makes no sense to say "whatever this thread happens to be doing, I
> want it to timeout in X time".
I agree with you that most of the time it wouldn't make sense.
This is a bit of a corner case, but it's possible to set up posix timers
to use various clock sources. If you set the timer to use a per-thread
cpu-time clock, then this allows you to trigger a timer to fire in X
amount of runtime.
This can be useful if what you care about is runtime rather than actual
wall clock time.
Chris
== 2 of 2 ==
Date: Thurs, Oct 1 2009 5:31 am
From: Deepak
On Sep 30, 8:21 pm, Chris Friesen <cbf...@mail.usask.ca> wrote:
> On 09/30/2009 08:55 AM, David Schwartz wrote:
>
> > Okay, let's start with a simple question -- why would anyone want a
> > thread-specific timer? What possible function could it serve? Whatever
> > it is that you want to impose a timeout on, why associate the timer
> > with a thread?
>
> > It makes no sense to say "whatever this thread happens to be doing, I
> > want it to timeout in X time".
>
> I agree with you that most of the time it wouldn't make sense.
>
> This is a bit of a corner case, but it's possible to set up posix timers
> to use various clock sources. If you set the timer to use a per-thread
> cpu-time clock, then this allows you to trigger a timer to fire in X
> amount of runtime.
>
> This can be useful if what you care about is runtime rather than actual
> wall clock time.
>
> Chris
Hi Chris,
Yes i am not interested in wall clock time, but needed a timer for X
amount of runtime, which can be different for different thread of my
app.
>If you set the timer to use a per-thread
>cpu-time clock, then this allows you to trigger a timer to fire in X
>amount of runtime.
So how does one use the per-thread cpu-time clock ?
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.programming.threads"
group.
To post to this group, visit http://groups.google.com/group/comp.programming.threads?hl=en
To unsubscribe from this group, send email to comp.programming.threads+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.programming.threads/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
No comments:
Post a Comment