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

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -