I have this dispute with my co-workers, i just wanted to know your opinion, maybe it can also help other people as well.
I have scheduler - ScheduledThreadPoolExecuter , one core thread
It wakes up every second to do some work. The work is to go over some Tasks (lets say 50) , and check their state ( ready , not ready ) if ready it submit them to some other threadpools. The state is a AtomicBoolean, so the check is quite easy.
So they say it's a lot of work for the CPU and waking up every second consumes a lot of CPU time , "lets make it better wake up every 15 seconds or so".
The work the cpu does on these tasks every minute sounds to me like a raindrop in a sea and scheduling a my runnable every minute is an eternity for the CPU (for instance if the executor has only one task, even if it has more than one task scheduled
Thanks in advance
Roman