• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threading Question

 
Sean Walker
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the book 'Sun Certified Programmer & Developer for Java2' the following point is a point made:
Only one thread can be running at a time, although many threads may be in the runnable state.

But this isn't necessarily true is it? If the JVM is running on a multiprocessor box surely more than one thread can be in the running state - no?
 
Loveen Jain
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, thats really a question that one needs to think about.
Although i havent done Parallel and Distributed Computing in much detail, but still as far as i know and can make out of ur question is that, when u are implementing a parellel algorithm then ofcourse more than one threads will be running at the same time(in case of parallel microprocessor architecture), but if its not the case than u must know that even if the underlying architecture is multiprocessor, only one processor will be handling the main control of the program and the rest will be working either as the coprocessors or might be doing some other jobs, so in this case JVM will be having only one thread in the running state.

~Loveen
 
Sean Walker
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You lost me.
What is a 'parallel algorithm' if not any program in which more than one thread is executing. Of course I am aware that some algorithms have parallel and serial counterparts, but that's beside the point isn't it?
Okay, I went googleing and found a link that I think pretty clearly describes how JVM's map to an underlying architecture's threading model.
web page
So in a one-to-one or many-to-many JVM model, you can have different threads running actually concurrently on separate processors.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic