I have been learning and experimenting with multithreading in Java. I have a quad core processor (with Hyper-threading). If I have 1 thread go in an infinite loop in it's run() function, it utilizes my CPU for 90%.
How can I limit this to 1 core (ie. 25%) or it can't be done? I ask out of curiosity. Thank you in advance.
I was able to use upto 90%/core by using pure threads with a BlockingQueue instead of an executorService. I have yet to experiment with BlockingQueue on ExecutorService - but with a concurrent list the Executor service was being synchronized.
Thank you all for your help! I really appreciate it.