multithreading - java Thread class run() method -
Thread class has introduced a way to implement business logic that can be executed in parallel. But I want to have a single run method and walk together. How to get this feature
Thanks
I think that the best course of action to do two different - There will be different threads.
You should (and possibly, want to) write a new class which implements Runnable
and its logic inside it. If there are general activities between two business arguments that you have to implement, then you can use this class as a base class for two "Runnables". Each runnabel
must be created in a separate thread.
You can find a great argument on this post for thread vs. runnable
:
Comments
Post a Comment