• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Threading Question

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic