site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=dtu4OmITicahCCQ0aa4xV1HQQZ5hgScE81bRnq4Rs9k=; b=Hj23+1TcLUIeW3GCRHVFTcNrSm6iWBoGedNqmA/cFxF4Ex/0uNvtn2ZfTTuMSsKkE5 YKhekxaJFTbesH0qOfN5FDsboui1SvMpUb19ZRUliQ4ihgJpTY0pLbKvJbXTpZy2xTuF mIrwMFcf+92lqLazHsdzcMncEF+IG5//Bzjp8= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eYVVZHowtb01E33K/batNCc9S6eQyj0hdytnj2C/6twS0yI88LbbeWw07Uy4qAjQsI pX0+VbkybUnIiKonw7EV2ypVSvymm2llj35bGyda8safDcRy23nfo2VH4ffVf9unQJ59 ckfiAHvcfiM82PG4FuduxjLGfJn3zYgmmmKek= maybe by clearing the descriptor or the timeout -> 0 On Tue, Dec 2, 2008 at 7:42 PM, Jamil Weatherbee <jamil@weatherbeecorporation.com> wrote:
This may be a simple one but I haven't figured it out.
Suppose you have a server that does (in pseudo code):
signal_handler () { if TERM signal then runserver = 0;
}
main () {
for (runserver=1;runserver;) { select (descriptors, timeout=1second);
do descriptor event based stuff; do periodic stuff;
}
exit gracefully;
}
Now if you send a TERM signal to this process but for whatever reason there is no activity on the file descriptors. Then the process will hang into the select() until a descriptor becomes ready. You would think that the 1 second should timeout and then it should exit gracefully (which is the intent).
It seems the best I can tell is that the select() call is getting restarted due to the signal but somehow it is restarted without the timeout.
Any easy solutions?
-Jamil
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/openspecies%40gmail.com
This email sent to openspecies@gmail.com
-- -mmw _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
mm w