Page 1 of 1

Cyclic Event - 3 Tasks

Posted: Mon Jul 28, 2014 8:56 am
by Helix78
I have to run 3 similar tasks frequently. The interval is not crucial but should be all 5-10 minutes.
During the operation of 1 task the other 2 tasks shall pause or not operate to not interfere with each other.
With 2 tasks it is easy, I would disable the other task or wait for finish.
I don't know the exact runtime of each task so I cannot set cyclic events of starting each 5 minutes the next task. Maybe one task hasn't finished within these 5 minutes.
If I disable the other tasks ans enable after finishing the 1st task they start immediately simultaneously...

Does someone have a brain input for me?

Re: Cyclic Event - 3 Tasks

Posted: Mon Jul 28, 2014 11:09 am
by Oleg
I think that the best way to solve this is to run the tasks sequentially.

suppose you have 3 tasks:
Task1
Task2
Task3

You need to run these tasks periodically but you need to guarantee that each task is being executed when other tasks are stopped.

You can make 4-th task with such actions :
start task1 and wait for finish
start task2 and wait for finish
start task3 and wait for finish


See action Start Task
Attach cyclic event to this task and remove triggering events from task1, task2, task3

This garantees that these tasks will not be overlapped.

2-nd way
Put the action "Wait for Task" in the beginning of each task.
If you have 3 tasks you need to wait 2 other tasks (you have to make 2 steps)
Pay attention that that you need to avoid "Infinity" parameter because you can to get "deadlock"

Re: Cyclic Event - 3 Tasks

Posted: Mon Jul 28, 2014 12:12 pm
by Helix78
Method 1 works perfectly! Thank you

Method 2 won't work because during waiting for task 2, task 1 could start in between. The waiting for tasks works sequentially not cummulative.