On Mar 30, 2007, at 3:57 PM, Philip Goetz wrote:
On 3/23/07, Ben Goertzel <[EMAIL PROTECTED]> wrote:
Additionally, we need real-time, very fast coordinated usage of multiple processors in an SMP environment. Java, for one example, is really slow
at context switching between different threads.

Java's threads are fairly heavy.  You can use Cybele to implement Java
agents that run on lighter threads; switching between them is much
faster.  I wrote the first version of NASA's ACES simulator using
Cybele; it had about 50,000 threads active at a time, running on a
single processor.

Or did you mean that you want to use multiple physical processors, and
a small amount of heavy threads?  That sounds like what you said, but
I assumed that isn't what you meant, because you wouldn't need to
switch between threads if you're really talking about CPUs.
I believe you can write your own routines for serialization in Java.


I think what Ben meant was that Java threads are a bit like typing in mittens. For some purposes the granularity is pretty coarse and that can cost serious performance. However, many applications don't have any such issues; it is a relatively narrow use case.

For a single core it is not much of an issue (at least not for me), but for some purposes it can be really hard to use multiple processing units effectively at the level of control available through Java. There are resource management possibilities in C that simply are not exposed in Java. As Ben mentioned above, extremely fast multi-processor coordination is far from ideal in Java compared to what is possible in C.

This is a good thing. Java is supposed to be portable and hide these kinds of bare metal characteristics. The only bad thing is that it is hard to get to the bare metal through Java if you need to.

Cheers,

J. Andrew Rogers

-----
This list is sponsored by AGIRI: http://www.agiri.org/email
To unsubscribe or change your options, please go to:
http://v2.listbox.com/member/?list_id=303

Reply via email to