From: "Peter T. Breuer" <ptb@inv.it.uc3m.es>
To: hannes@cmpxchg.org
Cc: "linux kernel" <linux-kernel@vger.kernel.org>
Subject: Re: time_is_after_jiffies misnomer
Date: Tue, 16 Dec 2008 17:04:52 +0100 (MET) [thread overview]
Message-ID: <200812161604.mBGG4qT10889@inv.it.uc3m.es> (raw)
In-Reply-To: From (env: ptb) at "Dec 16, 2008 04:17:30 pm"
"Also sprach ptb:"
> "Also sprach Johannes Weiner:"
> > 'foo jiffies'?
>
> ?? What does that mean? Yes, "the current time is later than foo
> jiffies", is what I wrote. I don't understand why you query it. What I
> wrote is a perfectly normal english sentence.
Light dawns. Perhaps you think "jiffies" is a meaningless word that
happens to be the name of a variable that measures elapsed time.
It's not. "jiffy" is a "short moment of time" in english, and "jiffies"
is its plural. Like "augenblick" in german, but a bit longer
("augenblick" probably translates as "moment", or "instant", literally,
"eyeblink"). "In a jiffy" is an english phrase meaning "soon!". It's
close to an "instant" but of vaguer extent.
So the variable called "jiffies" measures the number of elapsed
jiffies.
Like a variable called "hours" that measures the number of elapsed
hours.
"foo jiffies" is no stranger than "foo hours" or "foo minutes" or "foo
seconds". That's why I was puzzled that you queried it!
> It's poor english. Yes, to an english speaker
>
> time_is_after_jiffies(foo)
>
> looks like
>
> the current time is later than foo jiffies
>
> Look at the two:
>
> the current time is later than foo jiffies
> | | | `/.
> time_is_after_jiffies(foo)
See it now?
Imagine that you had a macro called
time_is_after_hours
then
time_is_after_hours(12)
would mean to an english speaker
the current time is later than midday
I.e.
the current time is later than 12h
| | | .|'
time_is_after_hours(12)
Unfortunately the kernel's "time_is_after_hours(12)" macro means
mathematically what we would express in english as "the current time is
BEFORE 12h". Ouch.
The kernel's
time_is_after_jiffies(500)
macro mathematically means
the current value of the jiffies variable is LESS THAN 500
!! That's the other way round from the way that an english speaker
would read the macro name as meaning! So the semantics and the name
contradict each other.
Clear now?
Peter
next reply other threads:[~2008-12-16 16:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-16 16:04 Peter T. Breuer [this message]
2008-12-16 16:13 ` Pekka Enberg
-- strict thread matches above, loose matches on Subject: below --
2008-12-16 11:31 Peter T. Breuer
2008-12-16 14:46 ` Johannes Weiner
2008-12-16 15:17 ` Peter T. Breuer
2008-12-16 16:18 ` Andreas Schwab
2008-12-16 16:32 ` Peter T. Breuer
2008-12-16 19:29 ` Chris Friesen
2008-12-16 20:33 ` Johannes Weiner
2008-12-18 7:38 ` Pavel Machek
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=200812161604.mBGG4qT10889@inv.it.uc3m.es \
--to=ptb@inv.it.uc3m.es \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®