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

olivier.dupuy@hrdc-drhc.gc.ca olivier.dupuy@hrdc-drhc.gc.ca
Tue, 22 Jul 2003 16:50:42 -0400


This is a multi-part message in MIME format.

------_=_NextPart_001_01C35092.EA87977E
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



	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=3Dipp_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_01C35092.EA87977E
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.5770.91">
<TITLE>Any support to determine the number of processors ?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<BR>
<BR>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">Hi,</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">I am currently in the process of implementing concurrency =
patterns such as Reactor&#8230;</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"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 </FONT><A =
HREF=3D"http://www.intel.com/technology/hyperthread/index.htm?iid=3Dipp_s=
rvr_proc_xeon+feature_f2htt&amp;"><U><FONT COLOR=3D"#0000FF" SIZE=3D2 =
FACE=3D"Arial">http://www.intel.com/technology/hyperthread/index.htm?iid=3D=
ipp_srvr_proc_xeon+feature_f2htt&amp;</FONT></U></A><FONT SIZE=3D2 =
FACE=3D"Arial">. I don't know about SPARC processors or other =
models.</FONT></P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"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.</FONT></P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"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).</FONT></P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">Let me know what you think and if this is a reasonnable =
wish...</FONT>
</P>
<BR>
<UL>
<P><B><I><FONT COLOR=3D"#008080" SIZE=3D2 FACE=3D"Century Gothic">Merci =
... Thanks</FONT></I></B>
</P>

<P><B><I><FONT COLOR=3D"#008080" SIZE=3D2 FACE=3D"Century =
Gothic">Olivier DUPUY</FONT></I></B>

<BR><B><I><FONT COLOR=3D"#008080" SIZE=3D2 FACE=3D"Century =
Gothic">Architecture and Internet Solutions (AIS)/Solutions Internet et =
Architecture.</FONT></I></B>

<BR><B><I><FONT COLOR=3D"#008080" SIZE=3D2 FACE=3D"Century =
Gothic">HRDC/DRHC, 18A, 333 River Road, Vanier, Ontario K1A =
0L1</FONT></I></B>

<BR><B><I><FONT COLOR=3D"#008080" SIZE=3D2 FACE=3D"Century Gothic">Ph. =
(613) =
946.7749&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; olivier.dupuy@hrdc-drhc.gc.ca</FONT></I></B><I></I>
</P>
</UL>
</BODY>
</HTML>
------_=_NextPart_001_01C35092.EA87977E--