From: Junio C Hamano <gitster@pobox.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: git@vger.kernel.org, Jonas 'Sortie' Termansen <sortie@maxsi.org>
Subject: Re: [PATCH 9/9] Use timer_settime for new platforms
Date: Fri, 29 Aug 2014 11:02:18 -0700 [thread overview]
Message-ID: <xmqqd2bj6uol.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1409330561-11806-9-git-send-email-jacob.e.keller@intel.com> (Jacob Keller's message of "Fri, 29 Aug 2014 09:42:41 -0700")
Jacob Keller <jacob.e.keller@intel.com> writes:
> From: Jonas 'Sortie' Termansen <sortie@maxsi.org>
>
> setitimer() is an obsolescent XSI interface and may be removed in a
> future standard. Applications should use the core POSIX timer_settime()
> instead.
>
> It's important that code doesn't simply check if timer_settime is
> available as it can give false positives. Some systems like contemporary
> OpenBSD provides the function, but it unconditionally fails with ENOSYS
> at runtime.
Doesn't this paragraph need tweaking? I think you lost (which is a
good thing) "notice that timer_settime() call failed with ENOSYS and
switch to setitimer()", no?
> Clean up the progress reporting and change it to use timer_settime,
> which will fall back to setitimer automatically if timer_settime is not
> supported. (see git-compat-util.h for how it does this). If both
> functions are not present, then git-compat-util.h provides replacements
> which will always fail with ENOSYS.
While this paragraph may be true if patch 8b and 9 are taken
together, isn't what it describes mostly what 8b did, not 9?
Here by 8b I mean the change to git-compat-util.h in 8; the patch
might want to be split into two, 8a for the autoconf part whose log
message may begin with "This function was not previously used by
git." and 8b that adds an emulation of timer_settime() API in terms
of setitimer() API, or the other way around.
What 9 did is only "we used to use the setitmer() API to implement
the progress reporting; now we use timer_settime() API" (yes, it is
thanks to the abstraction given by 8, but the "callers has to only
know about one API, not worrying about the other API" is a merit
attributable to 8b, not this one).
> The approach used here enables us to use a single API (timer_settime)
> without having to worry about checking for #ifdefs or if blocks which
> make it an unreadable nightmare. The major downside is for systems
> without timer_settime support, they may fall back on a wrapped
> implementation which could have subtle differences. This should be a
> minor issue as almost all modern systems provide timer_settime support.
As this paragraph.
> Note that this change means that git should never use setitimer on its
> own now, as the fallback implementation of timer_settime assumes that it
> is the sole user of ITIMER_REAL, and timer_delete will reset the
> ITIMER_REAL.
And this one.
next prev parent reply other threads:[~2014-08-29 18:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 16:42 [PATCH 1/9] git-compat-util.h: Add missing semicolon after struct itimerval Jacob Keller
2014-08-29 16:42 ` [PATCH 2/9] autoconf: Check for " Jacob Keller
2014-08-29 16:42 ` [PATCH 3/9] autoconf: Check for setitimer Jacob Keller
2014-08-29 16:42 ` [PATCH 4/9] autoconf: Check for timer_t Jacob Keller
2014-08-29 18:20 ` Jonas 'Sortie' Termansen
2014-08-29 16:42 ` [PATCH 5/9] autoconf: Check for struct timespec Jacob Keller
2014-08-29 16:42 ` [PATCH 6/9] autoconf: Check for struct sigevent Jacob Keller
2014-08-29 16:42 ` [PATCH 7/9] autoconf: Check for struct itimerspec Jacob Keller
2014-08-29 16:42 ` [PATCH 8/9] autoconf: Check for timer_settime Jacob Keller
2014-08-29 17:26 ` Johannes Sixt
2014-08-29 17:40 ` Keller, Jacob E
2014-09-10 15:33 ` Karsten Blees
2014-09-10 21:08 ` Junio C Hamano
2014-09-10 21:13 ` Keller, Jacob E
2014-08-29 16:42 ` [PATCH 9/9] Use timer_settime for new platforms Jacob Keller
2014-08-29 18:02 ` Junio C Hamano [this message]
2014-08-29 18:09 ` Keller, Jacob E
2014-08-29 18:12 ` Junio C Hamano
2014-08-29 16:48 ` [PATCH 1/9] git-compat-util.h: Add missing semicolon after struct itimerval Keller, Jacob E
2014-08-29 18:54 ` Jonas 'Sortie' Termansen
2014-08-29 19:07 ` Junio C Hamano
2014-08-29 19:43 ` Jonas 'Sortie' Termansen
2014-09-03 0:17 ` Keller, Jacob E
-- strict thread matches above, loose matches on Subject: below --
2014-08-28 1:04 [PATCH 0/9] Use timer_settime for new platforms Jonas 'Sortie' Termansen
2014-08-28 1:04 ` [PATCH 9/9] " Jonas 'Sortie' Termansen
2014-08-28 19:43 ` Junio C Hamano
2014-08-29 16:11 ` Keller, Jacob E
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqd2bj6uol.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=sortie@maxsi.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.