POSIX based Timer class, occasional crash

usenet_at_sta.samsung.com
Date: 09/28/05


Date: 28 Sep 2005 12:15:03 -0700

Here's what I've got.

I've got a Timer class and a TimerClient base class. The Timer class
maintains a mapping between the timer-id and information such as the
number of times to fire the timer, timer attributes, a pointer to the
client, and a pointer to a client specific "payload" that gets
delivered to the client with the timeout message. The Timer class is a
singleton, and it's a wrapper for POSIX timer functions
(timer_create, timer_settime, timer_delete). It's access to its
internal map is controlled via a pthread_mutex.

Every once in a while an application that is using the timer crashes,
and I am unable to figure out what might be happening. Any insight
will be appreciated.

I have posted the source to comp.sources.d

Thanks,
Gus



Relevant Pages

  • Re: Lahman, how ya doing?
    ... >> I'd started with a Timer class that keeps the total time separately in ... double event job I wound up rewriting a few member functions in the ... derived class identically except for different pointer types. ...
    (comp.object)
  • Re: Timers
    ... so do i set the interval to x amount of milliseconds based on milliseconds ... It seems to me your best bet is to determine the exact time in the future you want the timer to execute, calculate the difference between that exact time and "now", and then use the result of that as the timer delay for a one-shot timer. ... It will fire when the elapsed time has expired. ... Each timer class has a slightly different syntax for configuring it as a one-shot timer, so without knowing what class you're using, it's not possible to say for sure what you would want to do. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: when is threading better than a timer?
    ... Looks like I was using the right Timer class, ... Bob ...
    (microsoft.public.dotnet.languages.vb)
  • Re: thread differences from button_Click and timer_Elapsed
    ... it would be the timer that uses a different thread (it ... but rather get one from the thread pool). ... does that depends on which timer class you're using. ... compare them between the two executions ...
    (microsoft.public.dotnet.framework)
  • Re: POSIX based Timer class, occasional crash
    ... > I've got a Timer class and a TimerClient base class. ... > Every once in a while an application that is using the timer crashes, ...
    (comp.unix.programmer)