Skip to main content

how does jvm schedule core 2 duo multi-thread java

4 replies [Last post]
cohodetector
Offline
Joined: 2007-07-12
Points: 0

Hi,
I am using java.lang.Thread class to implement thread for my java image processing program. In my image processing program, i have the following... I have two classes. First class(ReadImages.java) reads images from the disk and the second class(ProcessImages.java) processes the images. The processing images take so much longer than reading images; hence, i subclass Thread to implement the second class to become more efficient and do a multi task. So it reads images and in the same times it process images.

My question is I have intel core 2 duo processor, and if i am using thread from java.lang.Thread, then does it doing time slicing or Simultaneous multithreading like run ReadImages.java on one core and run ProcessImages.java on another core? how does JVM schedule? also, I am using windows xp professional edition 32 bits.

thanks

Francis

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
linuxhippy
Offline
Joined: 2004-01-07
Points: 0

Java-level threads are hosted on top of native threads, therefor java itself shouldn't influence scheduling a lot.

cohodetector
Offline
Joined: 2007-07-12
Points: 0

>>Java-level threads are hosted on top of native threads, therefor java itself shouldn't influence scheduling a lot.

so java threads basically map to native threads? hence, if i have two threads then one thread runs in one core and the other threads runs in the other core for dual core processor. I have a windows XP 32 bits professional edition.

thanks

Francis

linuxhippy
Offline
Joined: 2004-01-07
Points: 0

> so java threads basically map to native threads?
Yes, java threads map to native ones.

> hence, if i have two threads then one thread runs in
> one core and the other threads runs in the other core
> for dual core processor.
most likely, yes.

Clemens

cohodetector
Offline
Joined: 2007-07-12
Points: 0

Thank you so much. I really appreciated. Now i am clear.

Francis