Results 1 to 4 of 4
  1. #1
    perl0101 is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default How to assigne Java thread to a specific cpu core

    Hello everyone,

    I want to ask a complicated question. How can I assign Java threads to specific core in a multi-threaded application. The underlyinsg OS can be Linux or Windows. Is there any option provided in JVM can do it?

    If I want to fork a process using C, how can I mix the Java and C together.

    I am looking forward your suggestions.

    Thank you.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I don't believe that core Java gives you this ability as it is as OS agnostic as possible, and this capability I believe would tie it too close to the OS. As for your second question, one way to tie Java and C together is via JNI.

  3. #3
    perl0101 is offline Member
    Join Date
    Feb 2010
    Posts
    2
    Rep Power
    0

    Default

    Can I fork several Java processes using C and letting each Java process run on a core? The benefit may be to reduce the interference.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,182
    Rep Power
    20

    Default

    I would expect the underlying CPU to handle the spread of threads. That's sort of what they do as a job. Trying to force it to work in another way strikes me as premature optimisation. I mean, do you know you actually have a problem?

Similar Threads

  1. Replies: 1
    Last Post: 07-17-2009, 09:08 AM
  2. Replies: 2
    Last Post: 11-08-2008, 11:40 AM
  3. query on core java
    By venkatallu in forum New To Java
    Replies: 1
    Last Post: 09-01-2008, 03:23 PM
  4. Core Java Vs. J2EE
    By evanp in forum New To Java
    Replies: 2
    Last Post: 07-23-2008, 02:27 PM
  5. A core java Question
    By chravikumar008 in forum New To Java
    Replies: 2
    Last Post: 04-21-2008, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •