It would be interesting tasks initiated from another task (with Start Task) runs in its
context and independently.
This is to have no deadlocks between tasks.
Example of use:
I do a common task that makes a series of operations with parameters.
I called this task in various other tasks that I do not control the trigger.
Currently, if two tasks require the common task of the two tasks lock.
So ideally, it should be that each can perform the common task of its own.
"Thread safe" task
"Thread safe" task
You can get deadlock effect when tasks waits each other infinite.
Suppose Task1 starts Task2 with waiting and Task2 starts Task1 with waiting.
Task1 waits Task2, and Task2 waits Task1. This is deadlock.
Your example:
Task1 starts CommonTask
Task2 starts CommonTask
If you want to guarantee that CommonTask will performed for each caller you should start CommoTask so:
Wait CommonTask
Start CommonTask with waiting
Wait For task waits until the task finished.
If CommonTask is not running then Wait For task will not wait.
In this case CommonTask will performed for each caller.
I can send you small examples if it's necessary
Suppose Task1 starts Task2 with waiting and Task2 starts Task1 with waiting.
Task1 waits Task2, and Task2 waits Task1. This is deadlock.
Your example:
Task1 starts CommonTask
Task2 starts CommonTask
If you want to guarantee that CommonTask will performed for each caller you should start CommoTask so:
Wait CommonTask
Start CommonTask with waiting
Wait For task waits until the task finished.
If CommonTask is not running then Wait For task will not wait.
In this case CommonTask will performed for each caller.
I can send you small examples if it's necessary
Re: "Thread safe" task
example pleaseOleg wrote: I can send you small examples if it's necessary
Re: "Thread safe" task
Example helped me
Thank you so much!

Re: "Thread safe" task
Yes but :
- if the commonTask must be call by a lot of tasks
- and the common task run during "long time",
all tasks are waiting... and there is a risk that at least, 2 tasks launch commonTask at the same time after waiting
For the moment I copy all steps in all tasks
- if the commonTask must be call by a lot of tasks
- and the common task run during "long time",
all tasks are waiting... and there is a risk that at least, 2 tasks launch commonTask at the same time after waiting

For the moment I copy all steps in all tasks

Chris
(Robotask v6.4.2 on Win2008 x64)
(Robotask v6.4.2 on Win2008 x64)