Is anyone aware of how any Runnables I can instantiate under Win XP? Thanks,
Ike
Thomas Weidenfeller - 13 Jan 2006 14:28 GMT
> Is anyone aware of how any Runnables I can instantiate under Win XP? Thanks,
It depends in which wall you manage to run first. No one knows exactly,
because there are several boundaries, which not only depend on the OS,
but e.g. also on the actual hardware (amount of memory, etc.).
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
opalpa@gmail.com - 13 Jan 2006 14:37 GMT
One huge factor is what kind of threading model is available. Not only
does the count of threads available vary by way more than one order of
magnitute but the speed of creation can easily vary by two orders of
magnitude. I don't know if multiple threading models are available in
Java under XP.
http://www.geocities.com/opalpaweb/
grahamdstewart@gmail.com - 13 Jan 2006 16:46 GMT
Ike,
Why do you need to know? If you're running up against a limit it would
suggest that some re-design should be considered.
cheers
Graham
Thomas Hawtin - 13 Jan 2006 18:49 GMT
> Is anyone aware of how any Runnables I can instantiate under Win XP? Thanks,
Running threads? A few thousand on 32-bit Windows. The key factor is not
memory, but virtual address space.
Each stack is contiguous. It doesn't have to be this way - a popular
procedure calling standard on ARM processors used chunks allocated on
the heap. However, having the stack in one piece is marginally faster,
particularly if you are deficient in registers.
I guess you know 32-bit machines have 4 GB logical address spaces
(typically). Some of that will be taken up by the heap and shared
libraries (DLLs) in awkward places. How man stacks, and therefore
threads, you can have depends on the address space left and the size of
the stack. You can get more threads in by lowering the stack size, which
in Sun JRE is done with -Xss. Note, only the first page needs to be
physically allocated at first. Others can be allocated on demand.
A well known benchmark that stresses number of threads is VolanoMarks.
Possibly this is responsible for the lowering of default stack sizes
(which can be a problem when, say, using serialisation).
http://www.volano.com/report/index.html
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
ricky.clarkson@gmail.com - 13 Jan 2006 19:36 GMT
> Is anyone aware of how any Runnables I can instantiate under Win XP
Runnables aren't threads. Runnables aren't even instantiable. You
need to implement the Runnable interface to make something that is
instantiable, and as such, the number of those implementations that you
can instantiate depends entirely on the implementation.
Normally an unbounded number.
A thread pool might be useful if you are really talking about
instantiating lots of Thread objects.
Roedy Green - 14 Jan 2006 05:03 GMT
>Is anyone aware of how any Runnables I can instantiate under Win XP? Thanks,
>Ike
Runnable is a Java Interface. It works the same on all platforms. For
an example see http://mindprod.com/jgloss/jframe.html
If you mean executable, see http://mindprod.com/jgloss/exec.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
jladd@bigpond.net.au - 14 Jan 2006 21:58 GMT
While is it good to know how many threads you can create, the other
thing to know is how to pool them,
as thread creation is expensive and in some situations reduces
performance.
Rgs, James
-----------------
http://www.jamesladdcode.com
Roedy Green - 15 Jan 2006 00:05 GMT
>While is it good to know how many threads you can create, the other
>thing to know is how to pool them,
>as thread creation is expensive and in some situations reduces
>performance.
see http://mindprod.com/jgloss/queue.html
the concurrent package has goodies for pooling.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.