Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2002 23:16:43 -0500 (EST)
From:      Garrett Wollman <wollman@lcs.mit.edu>
To:        =?iso-8859-1?q?shubha=20mr?= <shubha_mr@yahoo.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   untimeout reliable?
Message-ID:  <200210310416.g9V4GhqG062975@khavrinen.lcs.mit.edu>
In-Reply-To: <20021031040420.78826.qmail@web41112.mail.yahoo.com>
References:  <20021031040420.78826.qmail@web41112.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Thu, 31 Oct 2002 04:04:19 +0000 (GMT), =?iso-8859-1?q?shubha=20mr?= <shubha_mr@yahoo.com> said:

> Simply put,will untimeout cause to de-establish a
> timeout irrespective of the position/status of a
> timeout already scheduled?In other words,will
> untimeout prove futile sometimes?

No and yes, respectively.  If the timeout is already running,
untimeout (or more properly, callout_stop()) cannot do anything about
it.  All it can do is remove the timeout from the list of things to be
called next time.

What this means for a developer is that you need to provide some other
means of mutual exclusion, and you need to be very careful with
timeout handlers that reestablish their own timeouts.  (Such handlers
will need a ``go away'' condition that they can check before
rescheduling the timeout.)

The old timeout()/untimeout() interface is deprecated, by the way.
New applications should use callout_reset()/callout_stop() instead.

-GAWollman


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210310416.g9V4GhqG062975>