Initial threads, context switching, and thread killing require expensive processor cycles. Therefore, it is best to use Streaming that suits your requirements.
Various options are available:
Switching can be reduced by creating n threads based on your hardware configuration and other parameters.
The advantage of performers over Thread.start() :
- Use existing threads so that threads are not created every time a task is submitted.
- Flow control is performed by performers
source share