I want to implement a method which doing some processing work in my program. The problem is that method must exist in another thread and it will be called quite frequently.
I know I can createThread everything I use the method, but the creation and destroy time is undesired. I can also make the thread to run in a while loop with a sleep inside there, but I don't want that.
My question is that is there anyway I can implemented a method that exist in a separate thread, if you don't call it, it will stay there forever unless you destroy it, but if you call its method, it will run again? and also I can directly call this method directly from my program, cause my knowledge on thread is only in createThread method?
Thank you for reading this post.