03-09-2012 07:24 AM
It is actually not a performance issue. Performance is an issue under heavy load. Heavy load means that all worker threads of the job executor are busy all the time.
@Component("theServiceTask")
public class ServiceTask implements JavaDelegate {
private AtomicInteger order = new AtomicInteger(0);
@Override
public void execute(DelegateExecution execution) throws Exception {
order.getAndIncrement();
int sleeptimeMilliseconds = new Random().nextInt(5) * 1000;
long id = Thread.currentThread().getId();
System.out.println(order.get() + " - thread " + id + " sleeping " + sleeptimeMilliseconds + " ms");
Thread.sleep(sleeptimeMilliseconds);
System.out.println(order.get() + " - thread " + id + " finished");
}
}
1 - thread 20 sleeping 3000 ms
1 - thread 20 finished
2 - thread 20 sleeping 3000 ms
2 - thread 20 finished
3 - thread 20 sleeping 3000 ms
3 - thread 20 finished
4 - thread 20 sleeping 1000 ms
4 - thread 20 finished
5 - thread 20 sleeping 3000 ms
5 - thread 20 finished
6 - thread 20 sleeping 2000 ms
6 - thread 20 finished
7 - thread 20 sleeping 0 ms
7 - thread 20 finished
8 - thread 20 sleeping 2000 ms
8 - thread 20 finished
9 - thread 20 sleeping 3000 ms
9 - thread 20 finished
10 - thread 20 sleeping 4000 ms
10 - thread 20 finished
11 - thread 20 sleeping 3000 ms
11 - thread 20 finished
12 - thread 20 sleeping 0 ms
12 - thread 20 finished
13 - thread 20 sleeping 0 ms
13 - thread 20 finished
03-09-2012 07:43 AM
03-09-2012 07:51 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.