Detecting CPUs and cores

R

Roedy Green

which may mean that to comply software has to perform a socket check.

with JNI you can get the CPU model number. You can create a database
of information about various models. The problem is, the list is
enormous.

my little JNI utility can extract the following information.

cpuIdVendor:AuthenticAMD
cpuIdBrand:AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
cpuIdStep:2
cpuIdModel:11
cpuIdFamily:11
cpuSerNo:0
rdtsc:51095894167442

If you have docs on how to extract other info, I would be glad to add
it. It comes with source, intended to be used in your own code.
see http://mindprod.com/products1.html#PENTIUM
 
J

Joshua Cranmer

Really? It can't, by some law of mathematics, actually briefly run the
threads separately, then simultaneously, and see how fast their program
counters advance?

Take two programs:
Program A:
mov ecx, 10000
head: add eax, [ebx+ecx]
loop head

Program B:
0xb7023480: <<operations with huge cache miss rate>>
...
jmp far 0xb8023480

Program A would be doing useful work (presumably) yet only advance its PC
by a few bytes wheras Program B has advanced it by several MBs without
doing anything.

I don't know of any way to access the actual number of instructions
executed (it doesn't seem to have much of a use to me), so any heuristic
to measure usefulness would probably end up taking more time to compute
than savings generated.
 
E

Eric Sosman

Joshua said:
[...]
I don't know of any way to access the actual number of instructions
executed (it doesn't seem to have much of a use to me), so any heuristic
to measure usefulness would probably end up taking more time to compute
than savings generated.

Some CPUs (all UltraSPARCs for sure, at least some models
from Intel and AMD, probably Power) have counters that increment
on assorted low-level events: instruction issue or retirement,
branch prediction failure, various kinds of cache misses, and so
on. Exactly what gets counted and how you get access to the
count(s) is highly model-dependent, but it's certainly not out of
the question to find out how many instructions a thread executed
during its time on a CPU.

... but that still doesn't tell you what you want, which is
the thread's rate of "progress." For example, a thread spinning
on a spin-lock is executing instructions at a pretty good clip
(excellent locality in both the instruction and data streams), but
is making no "progress" whatsoever.

A slightly different but related (and possibly apocryphal)
story tells of a computer company that did a lot of instruction
tracing on their machines. Then they designed a new chip to
run the traced instruction sequences just as fast as possible --
but despite all this optimization, the new chip seemed to be no
faster (maybe a touch slower) than the old one. Then it dawned:
A CPU spends the huge majority of its time in the idle loop, which
their new chip executed at breathtaking speed ...

Instruction execution need not equate to "progress."
 
L

Lew

David said:
Some 3rd party software vendors are now licensing software based on
number of sockets instead of number of cores....

which may mean that to comply software has to perform a socket check.

Are they doing this with Java software?

I know that some Java partisans think it's the everything language, but that
sort of thing seems much more like systems programming than "write once, run
anywhere"-land. In any event, they couldn't use Java directly in a
cross-platform way to do that license check; they have to be relying on JNI or
some other platform-specific means to get this information.

Please understand that here in clj.programmer I am asking such $64K-questions
in a Java-centric way. I never denied that knowing this type of information
is useful, I only question how useful in a Java-oriented, cross-platform context.

As to whether this licensing approach works "better" than by the less
customer-friendly core count, the more friendly server count, or the commonly
offered concurrent usage count, what Everrr! Companies are simply seeking a
reasonable metric of usage volume on which to base pricing, as is their right.
One could argue in favor of various metrics, but they're all negotiable
anyway. Their purpose is merely to give vendor and buyer a common language
for the negotiation, is all. As long as the terms are (intelligibly)
disclosed negotiations can proceed in good faith.
 
T

Twisted

Companies are simply seeking a
reasonable metric of usage volume on which to base pricing, as is their right.

I don't know where you get this from. It makes sense for the electric
company, whose costs grow in proportion to clients' usage. But a
software vendor? The one cost that might grow in proportion to client
usage is support, and charging by the hour or by the incident for
support makes a lot more sense than charging by software usage; for
example a client better able to manage their installations without
outside help is rewarded with lower support costs in the one case but
not the other.

There's also nothing in copyright law to support metering usage in any
way other than "per install". We don't see differential pricing of
books based on usage. Charging extra to use the same software on a
dual-core machine is about as logical per copyright and other laws as
offering books with a 50% discount for one-eyed people. :p
One could argue in favor of various metrics, but they're all negotiable
anyway. Their purpose is merely to give vendor and buyer a common language
for the negotiation, is all. As long as the terms are (intelligibly)
disclosed negotiations can proceed in good faith.

WHAT negotiations? Have you ever actually been able to negotiate EULA
terms with a software vendor instead of just having their one-sided
legalese fun-fest shoved in your face by a popup? I sure haven't.
 
L

Lew

Twisted said:
WHAT negotiations? Have you ever actually been able to negotiate EULA
terms with a software vendor instead of just having their one-sided
legalese fun-fest shoved in your face by a popup? I sure haven't.

Yes.
 
T

Twisted


Well lucky you. Too bad your experience is highly nonrepresentative
and thus of no help to the vast majority of software users out there.

Personally, not only am I sticking as much as possible to free
software in the future, but I'm also absolutely refusing to ever spend
a dime on any software that requires I pay extra to run it on a dual-
core machine. Artificial scarcity is simply getting ludicrous. Next
they'll try outright metering usage like it was a rental ... or like
AOL used to do with every single bit of distinct functionality. We all
know what happened there: cheap, low-cost, priced-by-cost, commodity
internet access ate AOL alive. Software "rental" models will just
accelerate the demise of the traditional commercial software industry
as it gets chewed up and splinters of bone spat out by Gnu/FSF
offerings and the like. Microsoft is notably avoiding any talk of
rental models, probably because they just know that if Vista or
Windoze 7 or whatever was charged by the hour or some such bullsh!t,
it would be handing the desktop market to Linux on a silver platter.
(In the server market, they already did, and have been regretting it
ever since.)
 
L

Lasse Reichstein Nielsen

Twisted said:
I don't know where you get this from. It makes sense for the electric
company, whose costs grow in proportion to clients' usage. But a
software vendor? The one cost that might grow in proportion to client
usage is support, and charging by the hour or by the incident for
support makes a lot more sense than charging by software usage; for
example a client better able to manage their installations without
outside help is rewarded with lower support costs in the one case but
not the other.

You're missing the point. It's not whether it makes sense, but whether
you can get people to pay more.
The more hardware a company is willing to buy for the software
to run on, the more important the software appears to be, and the
more money the software seller can demand.

Perfectly logical, from a money making point of view :)

/L
 
E

Eric Sosman

Twisted said:
There's also nothing in copyright law to support metering usage in any
way other than "per install". We don't see differential pricing of
books based on usage. Charging extra to use the same software on a
dual-core machine is about as logical per copyright and other laws as
offering books with a 50% discount for one-eyed people. :p

Hey, Twisted: This is *my* product, and *this* is how much
I want you to pay me to use it under *these* terms. Nobody is
forcing you to accept my terms nor to pay my price -- but nobody
is forcing me to let you have my product on *your* terms and at
*your* price, either. If you don't agree to my terms and don't
accept my price, then don't use my product: You have, by your
actions, shown that my product isn't worth that much to you, so
you must be willing to do without. Go twist somewhere else:
twist and shout.

You may think my pricing policies foolish, and you may even
be right -- but that doesn't diminish my right to indulge my
folly. Who died and made you Pope?
WHAT negotiations? Have you ever actually been able to negotiate EULA
terms with a software vendor instead of just having their one-sided
legalese fun-fest shoved in your face by a popup? I sure haven't.

Terms are always negotiable. Negotiators approach the table
with different strengths and weaknesses, and it may happen that
your negotiating position is insufficiently strong to get Seer
to budge from theirs. Well, what that means is that Seer is
charging more than you think the product is worth: You therefore
make a bad trade by trying to pursue the deal. See what you
can do with Pregres or YourTRM instead -- or if you *really*
*really* need the Seer product, then admit that it's worth more
to you than you originally said.
 
T

Twisted

You're missing the point.

No, I am not.
It's not whether it makes sense, but whether you can get people to pay more.

In a proper, competitive market, you can't get people to pay much more
than your expenses, because if you try a competitor can easily
undercut your price while still operating at a profit.

Obviously, anywhere where software is being charged for by this sort
of extortionate scheme the market is insufficiently competitive, which
is not at all good for the consumer.
Perfectly logical, from a money making point of view :)

But not from a consumer rights point of view. It's high time
government stopped aiding and abetting corporations ripping off
consumers and returned to representing "we, the people". A good start
might be to strike down the legal artifice whereby corporations are
treated as a form of artificial "person". Don't let them be campaign
donors (just their employees and stockholders as individuals -- and
even then, don't let them donate to more than one party in a given
election cycle). Don't treat them as having any rights. Most
importantly, don't represent them. Represent only the actual people,
individual human beings that are capable of suffering in poverty or
dying or whatnot. The worst that can ever happen to a corporation is
bankruptcy, and given that it happens in a decent industrialized and
progressive democracy this doesn't kill the employees, just send them
looking for new work, which they should easily find if they have any
skills or talent that remain in demand.

Corporations have no special rights, particularly no right to exist or
to turn a net profit. Giving them such rights takes away from we, the
people. Corporations have their place in a society built on
competitive markets and free people with freedom of transaction. Let's
put them back in their place.
 
T

Twisted

Hey, Twisted: This is *my* product, and *this* is how much
I want you to pay me to use it under *these* terms. Nobody is
forcing you to accept my terms nor to pay my price -- but nobody
is forcing me to let you have my product on *your* terms and at
*your* price, either.

The market would be forcing you if the market were doing its job.
If you don't agree to my terms and don't accept my price, then
don't use my product: You have, by your actions, shown that my
product isn't worth that much to you, so you must be willing to
do without.

I should have the choice of a more reasonably priced, nigh-identical
product, given that the price you're asking far exceeds the cost of
providing it. If I don't have that choice there is market failure.
You may think my pricing policies foolish, and you may even
be right -- but that doesn't diminish my right to indulge my
folly. Who died and made you Pope?

The problem is if you can indulge your folly and not be eaten alive by
competitors with more reasonable, but still profitable, pricing. That
indicates market failure.

[snip a bunch of stuff including several unfamiliar names or
references that are not explained]
 
E

Eric Sosman

Twisted said:
The market would be forcing you if the market were doing its job.

*You* are the market. And you can force me by walking
away from my putrid deal, in all your mighty millions. I will
end up on the breadline, and cease to trouble you (except
now and then to beg for alms). I repeat: *you* are the market:
flex your muscles or go sit in the corner.
I should have the choice of a more reasonably priced, nigh-identical
product, given that the price you're asking far exceeds the cost of
providing it. If I don't have that choice there is market failure.

"Price" and "cost" are different things. "Cost" is something
I as a manufacturer cannot avoid incurring (I do my level best to
keep it as low as possible, but whatever I cannot eliminate remains
"cost"). "Price" is what I ask and what you are willing to pay
(if you aren't willing to pay, then there's no transaction). May
I ask a price lower than my cost? (Ever heard of a "loss leader?")
If so, why may I not ask a higher price? You are *always* free to
walk away and do without my overpriced junk. Who's stopping you,
you big, muscular market?
The problem is if you can indulge your folly and not be eaten alive by
competitors with more reasonable, but still profitable, pricing. That
indicates market failure.

So I'm eaten alive -- I don't see evidence that you are
inconsolable.
[snip a bunch of stuff including several unfamiliar names or
references that are not explained]

O-kay: let's take it very, ve-ry slowly. Did you ever see
the movie "2001: A Space Odyssey?" Do you remember the name of
the computer who/which was such an important character in that
movie? "HAL," right? "H," "A," "L." Did you never notice --
or if not the not the noticing type, were you never told -- of
the interesting relationship between those three letters and
another set of three letters also related to computers? I Bet My
socks you can figure it out, given time and a running start. If
you ponder it long enough, maybe you'll also be able to unscramble
"YourTRM."

"Seer" is a different kind of obfuscation, whose decipherment
requires something the initiates call "vocabulary."

But none of these word games is important. The point is
simply that if I offer to let you use my product in accordance
with terms T and for consideration of a payment P, but you think
T and P are out of line with my product's worth to you, then you
can try to talk me down. If I am obstinate, you can just walk
away from the deal, having made a wise economic choice. We are
both happy: You didn't pay more than my product was worth, I didn't
give in to your attempt to rob me -- two happy people; what's your
objection to that?
 
T

Twisted

public final post EricRebuttal007 {

"Price" and "cost" are different things. "Cost" is something
I as a manufacturer cannot avoid incurring (I do my level best to
keep it as low as possible, but whatever I cannot eliminate remains
"cost").

Are you intentionally missing the point? My point is that when there
is open competition in the marketplace, prices are driven down to
costs plus thin margins, rather than being hugely inflated above
costs. And therefore that if anyone is charging highly inflated prices
and not either going out of business or being forced to lower them by
market forces (their choice), the market is therefore failing to work
properly and furnish sufficient competition in that space. I want bugs
like that fixed. :p
"Seer" is a different kind of obfuscation, whose decipherment
requires something the initiates call "vocabulary."

[and a bunch more stuff about obfuscation]

What the **** did you think that was, proprietary source code?

It was a usenet posting. The object of the game is to communicate
clearly and meaningfully. Intentional obfuscation is clearly a losing
strategy.

Then again, maybe I have misunderstood usenet. Sometimes it sure does
seem as if the object of the game is to aggravate, flame, and
generally disagree with everyone else without regard to reason or
logic, and particularly without any consideration of those pesky
things called facts. :p
But none of these word games is important. The point is
simply that if I offer to let you use my product in accordance
with terms T and for consideration of a payment P, but you think
T and P are out of line with my product's worth to you, then you
can try to talk me down. If I am obstinate, you can just walk
away from the deal, having made a wise economic choice. We are
both happy: You didn't pay more than my product was worth, I didn't
give in to your attempt to rob me -- two happy people; what's your
objection to that?

That the very fact that you are making the terms of your deal so
onerous proves that there is no alternative to walk away to.

Also, that you're violating copyright law, particularly the doctrine
of first sale, by attempting to tell me what I can and cannot do with
a copy after I've purchased it already. That's as illegal as if I were
to infringe the copyright by making and selling copies without your
permission.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Twisted said:
In a proper, competitive market, you can't get people to pay much more
than your expenses, because if you try a competitor can easily
undercut your price while still operating at a profit.

Note that expenses in this context includes "normal profit".

Arne
 
T

Twisted

Note that expenses in this context includes "normal profit".

If by that you mean "a thin margin on top of parts, labour, shipping,
and handling" then fine. Keep in mind that the "labour" already
included is where all the salaries come from. A tough, competitive
market should keep any of those from being out of whack (such as the
CEO's) ideally as well.
 
J

Joshua Cranmer

If by that you mean "a thin margin on top of parts, labour, shipping,
and handling" then fine. Keep in mind that the "labour" already included
is where all the salaries come from. A tough, competitive market should
keep any of those from being out of whack (such as the CEO's) ideally as
well.

No, I think that she means "profits equal to that which would be
generated by the normal rate of return," which makes more sense since you
should put your money elsewhere if it can't get you the normal rate of
return.
 
P

Patricia Shanahan

Joshua said:
No, I think that she means "profits equal to that which would be
generated by the normal rate of return," which makes more sense since you
should put your money elsewhere if it can't get you the normal rate of
return.

It's also important to take into account the timing of expenses.
Typically, the costs for software are heavily front-loaded. It may be
necessary to employ many programmers for several years before gaining
much return.

The money paid to those programmers, and associated costs (office space,
workstations, unlimited free drip coffee, administration expenses,
benefits...), could have been invested elsewhere from the time it is
paid until the time it is recouped from the revenue stream.

The degree if risk also affects what is a "normal" rate of return.

At one extreme, government bonds for established, stable countries have
low risk but low rate of return. At the other extreme, venture capital
companies expect that many of their investments will fail, and need a
very high return from each of the few successes to cover those losses.

Software tends to be a high risk business, more like venture capital
than stable government bonds.

Patricia
 
J

Joshua Cranmer

Note that expenses in this context includes "normal profit".

[...]

No, I think that she means "profits equal to that which would be
generated by the normal rate of return," which makes more sense since
you should put your money elsewhere if it can't get you the normal rate
of return.

P.S. I am sorry if I got the gender wrong. I had assumed that Patricia
had made the earlier referent post, and in my speed, I forgot to verify
that fact. I humbly apologize.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top