Hi,
I am creating a functionality where I am using executor framework to do some task in parallel way.
For that I am creating a singleton class to create a ThreadPoolExecutor instance.
Here is the code:
My question is:
This RecordsDistributionExecutor is a singleton class to create and use ThreadPoolExecutor instance and only one instance can be created.
1. If the one instance is created then how it behave in multithreading / concurrent environment?
2. Can multiple threads execute the processData() method at a time?
From this I want to understand, how the methods access works in multithreading/concurrent environment for singleton class?
Thanks in advance,
Atul