Affinity in Java thread

0 votes

How do we lock down the individual threads contained within the Java processes that are specific to the CPU core. Any suggestion will be helpful.

Oct 31, 2018 in Java by 93.lynn
• 1,610 points

1 answer to this question.

0 votes

Well, as far as I know, I don't think Java allows that.

But you can use an underhand method where you need to make use of JNI in order to invoke the native codes that will execute the program. For more detail, you can refer here:

answered Oct 31, 2018 by code.reaper12
• 3,500 points

Related Questions In Java

0 votes
2 answers
0 votes
1 answer

How can you catch an exception thrown by another thread in Java?

This can be done using Thread.UncaughtExceptionHandler. Here’s a simple ...READ MORE

answered Dec 3, 2018 in Java by Frankie
• 9,810 points
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 49,969 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,220 points
0 votes
1 answer

difference between wait() and sleep() in java

We can find a big difference between ...READ MORE

answered Apr 26, 2018 in Java by developer_1
• 3,310 points
0 votes
1 answer

How to kill a thread in Java?

You can use a shared variable as ...READ MORE

answered Jun 6, 2018 in Java by Akrati
• 3,170 points
0 votes
1 answer

How to stop the Thread in Java?

Use a flag, which will indicate the ...READ MORE

answered Jun 11, 2018 in Java by Parth
• 4,630 points
0 votes
1 answer

Gracefully stopping a java thread

The preferable way will be to use a ...READ MORE

answered Aug 21, 2018 in Java by anto.trigg4
• 3,440 points
0 votes
1 answer

Purpose of “String args[]” in the “psvm” of Java

Let me give you the complete explanation ...READ MORE

answered May 7, 2018 in Java by code.reaper12
• 3,500 points
0 votes
1 answer

Need for finalize() in Java

finalize() is a method called by the ...READ MORE

answered May 9, 2018 in Java by code.reaper12
• 3,500 points