From: Junio C Hamano Subject: Re: [PATCH 1/2] Support for setitimer() on platforms lacking it Date: Tue, 04 Sep 2012 09:58:11 -0700 Message-ID: <7vzk55bu8s.fsf@alter.siamese.dyndns.org> References: <003301cd81e4$cd68daa0$683a8fe0$@schmitz-digital.de> <7vr4qqzsbe.fsf@alter.siamese.dyndns.org> <002201cd86ce$285841b0$7908c510$@schmitz-digital.de> <7vfw74s3oy.fsf@alter.siamese.dyndns.org> <003d01cd8827$34e90180$9ebb0480$@schmitz-digital.de> <7vpq64f935.fsf@alter.siamese.dyndns.org> <000d01cd89b6$d5ba6c30$812f4490$@schmitz-digital.de> <7v1uijexor.fsf@alter.siamese.dyndns.org> <003601cd8a0f$6a792840$3f6b78c0$@schmitz-digital.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: , "'Johannes Sixt'" To: "Joachim Schmitz" X-From: git-owner@vger.kernel.org Tue Sep 04 18:58:22 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T8wSD-0007LL-RR for gcvg-git-2@plane.gmane.org; Tue, 04 Sep 2012 18:58:22 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757396Ab2IDQ6O (ORCPT ); Tue, 4 Sep 2012 12:58:14 -0400 Received: from b-pb-sasl-quonix.pobox.com ([208.72.237.35]:46285 "EHLO smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753443Ab2IDQ6N (ORCPT ); Tue, 4 Sep 2012 12:58:13 -0400 Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 382EC99CB; Tue, 4 Sep 2012 12:58:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=bjsbRAVNa/ufom4iTbMuzYqAscw=; b=tH2Zxb Uwjckn304JP5QgwNS/8EX+14EbGeaTXomyYYVbuBGeesIlGg/juSv3cItQuhmd57 EUA3l5JobP6qE2v8C8yRJm/oEBzr/eyDYyIAvCdqSPw8H5zSJh3ylV3w9ITEgtHL iwM2gJmrsbTJxGW23MEJFXc1/oIjypksRf5SU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=HkGru/vHDC3AGYAq1i0QGmxgrbkZOyks 7nXQ0J9Y+LVpw7La9U16y4OVuUl3zzNpddqxvNvzbd/gcgUXAdfbr4VNIe4bSHAE 5Hxhx6UF6LzdKW2rCzkTiGcWGPQIQeo1jjFssjWsPnp9wRS0xiR8C+e8fJiEURA7 8Boej1kkXYU= Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 246F899CA; Tue, 4 Sep 2012 12:58:13 -0400 (EDT) Received: from pobox.com (unknown [98.234.214.94]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 7C32999C8; Tue, 4 Sep 2012 12:58:12 -0400 (EDT) In-Reply-To: <003601cd8a0f$6a792840$3f6b78c0$@schmitz-digital.de> (Joachim Schmitz's message of "Mon, 3 Sep 2012 22:05:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: B640AB68-F6B1-11E1-B1E0-BAB72E706CDE-77302942!b-pb-sasl-quonix.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: "Joachim Schmitz" writes: >> If you cannot re-trigger the timer, then you will see "20%" shown >> after one second, silence for 4 seconds and then "done", for an >> operation that takes 5 seconds. Which is not the end of the world, >> though. It does not affect correctness. > > That does seem to work, if I do e.g. a "git clone" on git itself > (being a fairly large repository), I see it updating the % values > about once per second. Ehh, so somebody is re-arming the alarm(). I am not sure where, though. ... thinks for a while, then a lightbulb slowly starts to glow ... Where are you cloning from, and does the other side of the clone (i.e. upload-pack) also run on your tandem port? If you are cloning from one of my public distribution points (e.g. k.org, repo.or.cz, or github.com), then I think the progress indicator you are seeing is coming from the other side, not generated by your local timer. Only with the observation of "clone", I cannot tell if your timer is working. You can try repacking the test repository you created by your earlier "git clone" with "git repack -a -d -f" and see what happens. > OK, I'll go for that one-liner in git-compat-utils.h then > > #ifdef NO_SETITIMER /* poor man's setitimer() */ > #define setitimer(w,v,o) alarm((v)->it_value.tv_sec+((v)->it_value.tv_usec>0)) > #endif > > It certainly seems to work just fine for me.