From mboxrd@z Thu Jan 1 00:00:00 1970 From: fwmiller@cs.umd.edu (Frank W. Miller) To: c++-embedded@cygnus.com Cc: fwmiller@cs.umd.edu (Frank W. Miller) Subject: Re: timer idioms in embedded system (fwd) Date: Fri, 26 Jun 1998 07:30:00 -0000 Message-id: <199806261430.KAA20384@yangtze.cs.umd.edu> X-SW-Source: 1998/msg00011.html Forwarded message: >From fwmiller Fri Jun 26 10:29 EDT 1998 From: fwmiller (Frank W. Miller) Message-Id: <199806261429.KAA20375@yangtze.cs.umd.edu> Subject: Re: timer idioms in embedded system To: shiva@well.com Date: Fri, 26 Jun 1998 10:29:36 -0400 (EDT) Cc: fwmiller (Frank W. Miller) In-Reply-To: < 35931852.1509@compuserve.com > from "Ken" at Jun 25, 98 08:41:06 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Content-Length: 929 > I'd like to change this to use a single counter incremented by the > interrupt. Client code would wait for the counter to increment to a > desired value. Example wait code might be > You might want to look at the timer management for TCP in XINU. They keep a list of timeouts. All but the first are deltas so the first element is the only one decremented on an interrupt. Check Comer's ``Internetworking with TCP/IP: Vol 2''. > How should I handle rollover? I expect the counter to be 32-bit, and the > interrupt tick to be 1 millisecond. The rollover should occur about > every 46 days. > I use a daemon that pops up every so often, once a day or once a week, and resets the counter. Later, FM -- Frank W. Miller Department of Computer Science fwmiller@cs.umd.edu University of Maryland http://www.cs.umd.edu/~fwmiller College Park, Maryland 20742