[concurrency-interest] Any support to determine the number of processors ?

Gary Gregory ggregory@seagullsw.com
Tue, 22 Jul 2003 18:09:02 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C3509D.DBD17250
Content-Type: text/plain

You'd expect this to show up as a System property, like today we have:

 

sun.cpu.endian = little

sun.cpu.isalist = pentium i486 i386

 

Maybe 1.5 will have a "sun.cpu.count" or some such.

 

Gary

 

-----Original Message-----
From: olivier.dupuy@hrdc-drhc.gc.ca [mailto:olivier.dupuy@hrdc-drhc.gc.ca] 
Sent: Tuesday, July 22, 2003 13:51
To: concurrency-interest@altair.cs.oswego.edu
Subject: [concurrency-interest] Any support to determine the number of
processors ?

 

 

        Hi, 

        I am currently in the process of implementing concurrency patterns
such as Reactor... 

        When working with a pool of threads, you can decide to optimize its
size according to the number of processors of your computer and to the tasks
realized. This way you should be able to optimize the processing and you
would avoid involving the user in configurating some resource file while
default values can apply automatically. I was searching in the JSR 166 for a
method giving access to number of logical and physical processors. On some
recent Intel processors, like PIV or Xeon, the hyperthreading technology
let's you execute up to 2 threads simultaneously
<http://www.intel.com/technology/hyperthread/index.htm?iid=ipp_srvr_proc_xeo
n+feature_f2htt&>
http://www.intel.com/technology/hyperthread/index.htm?iid=ipp_srvr_proc_xeon
+feature_f2htt&. I don't know about SPARC processors or other models.

        It is possible to obtain the number of logical/physical processors
possible using some native code (cf. Java Threads, Scott Oaks and ?,
O'Reilly for # of physical processors) but it is not portable.

        IMO a new concurrency library would be the ideal place/time to
introduce this information for all the JVMs as 2 methods of the System class
or as 2 system properties (cleaner).

        Let me know what you think and if this is a reasonnable wish... 

 

Merci ... Thanks 

Olivier DUPUY 
Architecture and Internet Solutions (AIS)/Solutions Internet et
Architecture. 
HRDC/DRHC, 18A, 333 River Road, Vanier, Ontario K1A 0L1 
Ph. (613) 946.7749               olivier.dupuy@hrdc-drhc.gc.ca 


------_=_NextPart_001_01C3509D.DBD17250
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 10 (filtered)">
<title>Any support to determine the number of processors ?</title>

<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"Century Gothic";
	panose-1:2 11 5 2 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;}
p
	{margin-right:0in;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman";}
span.EmailStyle18
	{font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><!-- Converted from text/rtf format -->You'd
expect this to show up as a System property, like today we have:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>sun.cpu.endian = little</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>sun.cpu.isalist = pentium i486 i386</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Maybe 1.5 will have a "sun.cpu.count"
or some such.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
  10.0pt;font-family:Arial;color:navy'>Gary</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b>
olivier.dupuy@hrdc-drhc.gc.ca [mailto:olivier.dupuy@hrdc-drhc.gc.ca] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, July 22, 2003 13:51<br>
<b><span style='font-weight:bold'>To:</span></b>
concurrency-interest@altair.cs.oswego.edu<br>
<b><span style='font-weight:bold'>Subject:</span></b> [concurrency-interest]
Any support to determine the number of processors ?</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Hi,</span></font>
</p>

<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I am
currently in the process of implementing concurrency patterns such as
Reactor...</span></font> </p>

<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>When working
with a pool of threads, you can decide to optimize its size according to the
number of processors of your computer and to the tasks realized. This way you
should be able to optimize the processing and you would avoid involving the
user in configurating some resource file while default values can apply
automatically. I was searching in the JSR 166 for a method giving access to
number of logical and physical processors. On some recent Intel processors,
like PIV or Xeon, the hyperthreading technology let's you execute up to 2
threads simultaneously </span></font><a
href="http://www.intel.com/technology/hyperthread/index.htm?iid=ipp_srvr_proc_xeon+feature_f2htt&amp;"><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>http://www.intel.com/technology/hyperthread/index.htm?iid=ipp_srvr_proc_xeon+feature_f2htt&amp;</span></font></a><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>. I don't
know about SPARC processors or other models.</span></font></p>

<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>It is
possible to obtain the number of logical/physical processors possible using
some native code (cf. Java Threads, Scott Oaks and ?, O'Reilly for # of
physical processors) but it is not portable.</span></font></p>

<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>IMO a new
concurrency library would be the ideal place/time to introduce this information
for all the JVMs as 2 methods of the System class or as 2 system properties
(cleaner).</span></font></p>

<p style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Let me know
what you think and if this is a reasonnable wish...</span></font> </p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p style='margin-left:1.0in'><b><i><font size=2 color=teal face="Century Gothic"><span
style='font-size:10.0pt;font-family:"Century Gothic";color:teal;font-weight:
bold;font-style:italic'>Merci ... Thanks</span></font></i></b> </p>

<p style='margin-left:1.0in'><b><i><font size=2 color=teal face="Century Gothic"><span
style='font-size:10.0pt;font-family:"Century Gothic";color:teal;font-weight:
bold;font-style:italic'>Olivier DUPUY</span></font></i></b> <br>
<b><i><font size=2 color=teal face="Century Gothic"><span style='font-size:
10.0pt;font-family:"Century Gothic";color:teal;font-weight:bold;font-style:
italic'>Architecture and Internet Solutions (AIS)/Solutions Internet et
Architecture.</span></font></i></b> <br>
<b><i><font size=2 color=teal face="Century Gothic"><span style='font-size:
10.0pt;font-family:"Century Gothic";color:teal;font-weight:bold;font-style:
italic'>HRDC/DRHC, 18A, 333 River Road, Vanier, Ontario K1A 0L1</span></font></i></b>
<br>
<b><i><font size=2 color=teal face="Century Gothic"><span style='font-size:
10.0pt;font-family:"Century Gothic";color:teal;font-weight:bold;font-style:
italic'>Ph. (613)
946.7749&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
olivier.dupuy@hrdc-drhc.gc.ca</span></font></i></b> </p>

</div>

</body>

</html>

------_=_NextPart_001_01C3509D.DBD17250--