top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How do you force start a Thread in Java?

+1 vote
667 views
How do you force start a Thread in Java?
posted Apr 23, 2015 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

This question is like how do you force garbage collection in Java, their is no way, though you can make request using System.gc() but its not guaranteed. On Java multi-threading their is absolute no way to force start a thread, this is controlled by thread scheduler and Java exposes no API to control thread schedule. This is still a random bit in Java.

answer Apr 24, 2015 by Karthick.c
Similar Questions
+3 votes

I need to call this class from a background thread.

ChartPenData.main(arguments);

How can I do that?

Thread thread = new Thread();
thread = ChartPenData.main(arguments);
thread.run();
...