The processing that you are doing is trivial, so the overhead of creating threads is more expensive.
If you had expensive operations which could be done in parallel then multi threads make sense.
More Related Contents:
- Java: Why main class does not extend Thread class [closed]
- What is the volatile keyword useful for?
- Using threads to make database requests
- Why must wait() always be in synchronized block
- How can I kill a thread? without using stop();
- Threads with Key Bindings
- Volatile vs Static in Java
- How can I pass a parameter to a Java Thread?
- Killing thread after some specified time limit in Java
- Is a HashMap thread-safe for different keys?
- Choose between ExecutorService’s submit and ExecutorService’s execute
- is there a ‘block until condition becomes true’ function in java?
- java.lang.IllegalMonitorStateException: object not locked by thread before wait()?
- What are the main uses of yield(), and how does it differ from join() and interrupt()?
- Printing Even and Odd using two Threads in Java
- ScheduledExecutorService Exception handling
- Constantly Update UI in Java FX worker thread
- Prevent Swing GUI locking up during a background task
- Java ExecutorService: awaitTermination of all recursively created tasks
- How to use invokeAll() to let all thread pool do their task?
- Thread safety of static blocks in Java
- Methods that Clear the Thread.interrupt() flag
- How to abort a thread in a fast and clean way in java?
- Jboss Java EE container and an ExecutorService
- Why is there no GIL in the Java Virtual Machine? Why does Python need one so bad?
- Java getting download progress
- java.lang.OutOfMemoryError: unable to create new native thread error using ChromeDriver and Chrome through Selenium in Spring boot
- LinkedBlockingQueue vs ConcurrentLinkedQueue
- How to restart thread in java? [duplicate]
- Random over ThreadLocalRandom