scheduled tasks - Java - thread Pool -
my scheduled thread pool--->
private static scheduledexecutorservice pendingcheckscheduler = executors.newscheduledthreadpool(1);
thread 1--->
private scheduledfuture<?> pendingtranstatuscheckhandle=pendingcheckscheduler.scheduleatfixedrate(new pendingtranstatuscheck(),0,checkforpendingtrans,timeunit.seconds );
thread2--->
private scheduledfuture<?> forciblebatchclosehandle=pendingcheckscheduler.schedule(new forciblebatchclose(), waitforpendingtrans, timeunit.minutes);
thread 1
executing every 10 seconds.thread 2
supposed start after 30 minutes.
thread 1
behaving expected thread2
expected start after 30 minutes,is starting after 1 hour.
does latency in thread1
contributing problem?if so,thread2
supposed givcen priority when thread 1 finishes considering have 1 thread in thread pool.why thread2
stretched long start after 1 hour?
i clueless , expect pointers.please me.
your concepts off, offsets conclusions. have one thread altogether, , 2 tasks scheduled run on 1 thread. can expect interference if repeated task executes long time, occupying thread.