With JDK >= 1.5, should the preferred way to start a thread always be an Executor or Executor Service, or are there still reasons to prefer to use a Thread.start if you don’t need what an ExecutorService provides?
For syncronized, I used to think that using the new Lock implemenations was preferred, until I was explained otherwise. So I’m wondering the same thing about Executors. Are they just a way of handling more complex cases, or should they be the standard choice?
Personally, since Java 5, I’ve completely left over
ThreadandThreadGroup, as they provide way less customization and functionality thanExecutorService.When using
ExecutorService, I know I can useCallable, I know I can (with a little overhead) schedule repeated tasks. As a consequence, I consider direct instantiation ofThreadobjects deprecated code, asVectorandHashtableare.