aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threading  Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threading  Question" Watch "Threading  Question" New topic
Author

Threading Question

Sean Walker
Ranch Hand

Joined: Feb 04, 2004
Posts: 64
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?


Sean Walker<br />PMP, SCEA, SCWCD, SCJP
Loveen Jain
Ranch Hand

Joined: Jan 24, 2004
Posts: 35
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

Joined: Feb 04, 2004
Posts: 64
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Threading Question
 
Similar Threads
Switching of threads !!!
Need your help about the keyword transient!!!(scjp07-Q161)
Threads question from Kahalid's exam..
Will a started thread run to completion in this example?
Thread scheduler