From the course: Java EE: Concurrency and Multithreading
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
ThreadFactory API
From the course: Java EE: Concurrency and Multithreading
ThreadFactory API
- [Instructor] Now let's talk about the ThreadFactory API. Executor API by default uses a Thread factory implementation present inside it to create threads for the application. Let's recollect our discussion. Let me open the Test Executors class and if you recollect our discussion on line number 30, we had used this factory method, new Fixed Thread Pool in order to get the Executor Service object. Now, since you have not mentioned any kind of Thread factory reference here, by default it is falling back to the default implementation on Thread factory. So, the Thread factory's going to manufacture threads and insert them into the pool and those threads are going to be reused. So, whenever you use the executor's default Thread factory implementation, it will create threads for you, all of which are in the same thread group with the same non-priority priority. Non-priority is basically number five and a non-demand stasis. And whenever you have used the fixed thread pool, or let's say, the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Features of the Executor framework and thread pools4m 35s
-
(Locked)
Callables and futures2m 16s
-
(Locked)
Executor and ExecutorService3m 58s
-
(Locked)
ExecutorService overview3m 3s
-
(Locked)
Define UserDao and user beans6m 50s
-
(Locked)
Write the UserProcessor callable implementation5m 31s
-
(Locked)
Write a test class and run the application10m 48s
-
(Locked)
Different thread pools5m 20s
-
(Locked)
ExecutorService: invokeAny and invokeAll7m 18s
-
(Locked)
ExecutorService shutdown5m 18s
-
(Locked)
ScheduledExecutorService overview2m 7s
-
(Locked)
The schedule method5m 16s
-
(Locked)
scheduleAtFixedRate and scheduleWithFixedDelay6m 42s
-
(Locked)
ThreadFactory API2m 34s
-
(Locked)
Create a custom thread factory5m 26s
-
-
-
-