Prioritizing Tasks

Since AutoMate™ is fully multi-threaded, it has the capability of running many tasks simultaneously.  As a result, it is occasionally required when building an automated task that the task run independent from other tasks in some way, for example by running alone and uninterrupted.

The Priority feature in AutoMate™ gives you the power to do just that.  AutoMate can be instructed as to whether or not to run a task in conjunction with other tasks, and how to handle a conflict if one arises between tasks.  For example, such as feature is useful when a task must make sure that an application stays in the foreground (also called focused) in order to send keystrokes to it. If another task were to run and try to focus an unrelated application,  it would interfere with the task that is attempting to send keystrokes.

Task Prioritization involves two points: first, under what conditions the task will not be allowed to run (priority condition), and secondly what to do with the task such a condition arises (priority conflict action).

Task Priority can be set for the following conditions:

Always Run
The task is free to operate alongside other tasks, and runs without checking any priorities.  This does not make it immune from being suspended, stopped or queued by another task that has already begun with priorities that conflict with this task.

Limit number of simultaneous instances of this task
AutoMate checks if running the current task will cause the total number of running tasks by the same name to exceed the specified value.  If so, AutoMate uses the selected priority conflict action (see below).

Limit number of simultaneous tasks
AutoMate checks if running the current task will cause the total number of running tasks to exceed the specified value.  If so, AutoMate uses the selected priority conflict action (see below).

Run Alone
The task only runs if there are no other tasks running (this is analogous to "Limit number of simultaneous tasks" with the total allowable tasks set to 1)

 

When a task cannot run because its priority condition is not met, the task is either ignored and never run, or placed into a queue of waiting tasks.  The queue is examined each time a running  task ends, and priority conditions of each queued tasks are reevaluated to see if the task can now be run.

Available priority conflict actions:

Hold task indefinitely
The task is placed into the "waiting tasks queue" until all other prioritized tasks have completed.  Then, the task is taken from the queue and run.

Hold task then abort
The task is placed into the "waiting tasks queue" and waits for the amount of minutes specified.  If the time elapses before conditions change that allow the task to run, the task is removed from the queue and discarded.  If a schedule triggered the task, it is rescheduled based on its scheduling properties.

Hold task then interrupt all running tasks
The task is placed into the "waiting tasks queue" and waits for the amount of minutes specified.  If the time elapses before the conditions change to allow the task to run, all the tasks currently running on the system are forcibly stopped, and the current task begins.

Interrupt all other running tasks
All tasks currently running are forcibly stopped and the current task runs immediately.  When used in conjunction with the "Run Alone" priority condition, this gives a task ultimate running power.

Interrupt all other running instances of this task
All tasks by the same name as the current task are interrupted and the current task begins immediately.

Don't run
The task does not run.  If a schedule trigger started the task, the task is rescheduled based on the trigger properties.

Tasks that have been placed into the queue can be removed or forced to run immediately using the Running Tasks dialog.

See Also:

Removing Waiting Tasks From The Queue

Forcing A Waiting Task To Run