Is this possible to queue multiple Runnable objects to wait for execution in one thread? How it can be done without using ExecutorService? What’s gonna happen if one of those Runnable objects threw unchecked exception, does it stop executing thread?
Share
Use an ExecutorService.
Use a BlockingQUeue and Thread.
That’s up to you since you have to writ this yourself.
For an ExecutorService, the Throwable thrown is added to the Future object for you to check. Its very easy to forget to do this, in which case you need to add a try/catch block to you Runnable.