Start task in parallèle

Discuss RoboTask here
Post Reply
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Start task in parallèle

Post by Vara04 »

Hello,

I wanted to use the use of the call to another spot by
spot.
But I wonder if I made the right choice.
Here is my problem:
I have a task (CommonTask) which is called by other
tasks.
What happens when two tasks called simultaneously
CommonTask?
Or when a task calls CommonTask which is currently
processing of action for another task?

Does CommonTask can run in parallel?
Are the calls are serialized CommonTask?

I feel that sometimes CommonTask is not called.
Oleg
Site Admin
Posts: 3031
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Start task in parallèle

Post by Oleg »

RoboTask can start the task only once at a time. If you try to start the task that is already working the RoboTask will ignore this.
If you need to be sure that the task is inactive you need put "Wait for Task" action before starting the task.
If the task is already running "Wait for Task" will wait until the task will be finished. If the task is inactive "Wait for task" will not wait and the task will proceed to next step.
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Start task in parallèle

Post by Vara04 »

Ok thanks
I'm going to modify my task in consequence.
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

Re: Start task in parallèle

Post by userXXX »

Hello Oleg,

I understood, that parallelization is not possible regarding an individual task.
But I need it! ;)

My idea is, to use robotask to control and execute long chains of tasks. Doing one task after the other is no problem, but is takes to long to wait till a chain ends and then start the same chain again (with other parameters). The database has enough performance to do more things parallel.

Example:

Task A, B, C, D, E are called sequentially by task MASTER and get's different parameter (the main purpose of the tasks is to start SQLs).
Every day MASTER has to start the whole chain (A, B, C, D, E) 25 times.
It could by possible, to run 5 of each task parallel (from database' point of view).

My idea:
I make a copy of each of my tasks (A,B,C,D,E) and call them A1,A2,...,A5,B1,...,B5,... and so on.
Via Basic script I check, which tasks are running and which are not by using "RoboTaskApp.TaskInfoState(ByVal NumTask as Long)" and checking for return value "3 - (tsRunning) the task has been launched and it is running".
If one is available, it will be started and the script will check other tasks...

Did you understand what I mean?
What do you think about it? Acceptable way? Any other suggestion?

Thanks.
Oleg
Site Admin
Posts: 3031
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Start task in parallèle

Post by Oleg »

I think you want to have ability to start one task several times simultaneously.
This is impossible now. RoboTask ignores attempts to start already running task.

But I wrote this into our ToDo. We'll investigate the problem.
Oleg Yershov
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

Re: Start task in parallèle

Post by userXXX »

Oleg wrote:I think you want to have ability to start one task several times simultaneously.
Yes, please. ;)
Oleg wrote:This is impossible now. RoboTask ignores attempts to start already running task.
I know...

If "running a task simultaneously" is to difficult to realize, maybe this would be easier: During runtime a task could make a (temporary) copy (like "duplicate" in the content menu of the task list) of another task and start it...
Stupid idea? :roll:
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

Re: Start task in parallèle

Post by userXXX »

Oleg wrote:RoboTask ignores attempts to start already running task.
This could really be a problem...

See my tasks, please. There's a sub-task which should be called from other tasks.
To simulate a few other tasks (they can theoretically run at the same time) starting the sub-task I created test_main_start_5. The tasks test_main1 to test_main5 are all started without waiting.
At the end I get only one file written instead of 5.

Do you have an idea for a workaround? Otherwise there's always a small probability that I "loose" some tasks because they don't run or raise an error.
In a special project I would like to use Robotask for, this behavior of the tool is a kind of dangerous.

Do you think it could work to implement a basic script (instead of using "Wait for task") that handles parallel "Start task" actions? Maybe your idea with using global variables (to hold info, which task runs sub-task currently) works in this case, too.
Attachments
Tasks.zip
(4.1 KiB) Downloaded 1552 times
Oleg
Site Admin
Posts: 3031
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Start task in parallèle

Post by Oleg »

This is really good example, thank you.
It seems that this is the problem and we need to change something in RoboTask's engine to make it work properly.
Oleg Yershov
Oleg
Site Admin
Posts: 3031
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Start task in parallèle

Post by Oleg »

Try RoboTask version 6.4 please. We added new optoin into Start Task action: Required start
See screenshot below.
start task.png
start task.png (24.89 KiB) Viewed 30749 times
Also we tested this on these examples. It works correctly:
New-Tasks.zip
(7.59 KiB) Downloaded 1430 times
Oleg Yershov
Post Reply