IP Library Granted Patent US 12705102
Granted Patent B2
US 12705102 · App. 18/185,262 · Granted Aug 11, 2026

Parallelism with task dependencies in a curated experience

Inventors: Billy Ma (San Francisco, CA); Anthony Lai (San Francisco, CA); Liang Xie (San Francisco, CA); Huiyuan Li (San Francisco, CA); Aaron Chan (San Francisco, CA); Pranit Shah (San Francisco, CA)
G06F9/5038G06F2209/5017G06F2209/5018
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12705102
App. No.
18/185,262
Granted
Aug 11, 2026
Kind
B2
Abstract

A method in a computing environment for application start up includes: generating a directed acyclic graph (DAG) for tasks that are performed during application start-up; performing topological sorting of the tasks based on the DAG to define an order for the tasks; allocating a tenant-specific priority queue; loading the tasks in the tenant-specific priority queue in the order determined by the topological sorting; allocating a plurality of computing threads to executing the tasks; executing the tasks using the plurality of computing threads that were allocated, wherein a plurality of the tasks are executed in parallel, and the tasks are assigned to the computing threads in an order based on the order in which the task are loaded in the tenant-specific priority queue; preparing a start page for use in accessing the application; and causing the start page to be displayed on a user access device for accessing the application.

Claims (85)

1 . A method comprising:

writing application code to utilize parallel processing to speed up application loading at application start-up for an application accessible via a multi-tenant computing environment that includes multiple computing threads, wherein writing the application code comprises selecting an application plan for the application loading at the application start-up, wherein selecting the application plan comprises identifying a plurality of jobs to be executed to load the application at the application start-up and identifying a plurality of tasks within each of the plurality of jobs;

generating, for a first tenant, a directed acyclic graph (DAG) for the plurality of tasks to be executed to load the application at the application start-up, wherein the DAG comprises a plurality of nodes, wherein each of the plurality of nodes corresponds to a task of the plurality of tasks to be executed to load the application at the application start-up;

performing topological sorting of the plurality of tasks to be executed to load the application at the application start-up based on the DAG to define an order for the plurality of tasks, wherein performing the topological sorting of the plurality of tasks to be executed to load the application at the application start-up comprises:

(a) identifying a node of the DAG with zero indegree, wherein the identified node corresponds to a unique task of the plurality of tasks to be executed to load the application at the application start-up;

(b) storing the unique task of the plurality of tasks to be executed to load the application at the application start-up corresponding to the node with zero indegree in a stack and deleting the node with zero indegree from the DAG;

(c) deleting edges originating from the node with zero indegree from the DAG; and

(d) repeating operations (a) through (c) until no nodes with zero indegree are left in the DAG;

allocating from the multi-tenant computing environment a tenant-specific priority queue for the first tenant;

loading the plurality of tasks to be executed to load the application at the application start-up in the tenant-specific priority queue in the order determined by the topological sorting of the plurality of tasks to be executed to load the application at the application start-up;

allocating a plurality of computing threads from the multiple computing threads to execute the plurality of tasks;

executing the plurality of tasks using the plurality of computing threads that were allocated, wherein multiple tasks of the plurality of tasks are executed in parallel, and the plurality of tasks are assigned to the plurality of computing threads in an order based on the order in which the plurality of tasks are loaded in the tenant-specific priority queue;

preparing a start page for use in accessing the application; and

causing the start page to be displayed on a user access device for accessing the application.

2 . The method of claim 1 , comprising a registration phase, followed by a build-time phase, and followed by a run-time phase, wherein:

the registration phase occurs when a tenant organization registers for access to the application;

the build-time phase occurs before a user-request to access the application;

the run-time phase occurs after a user-request to access the application; and

the generating the DAG occurs during the build-time phase.

3 . The method of claim 2 , wherein the performing topological sorting of the plurality of tasks based on the DAG to define the order for the plurality of tasks occurs during the build-time phase.

4 . The method of claim 2 , wherein the performing topological sorting of the plurality of tasks based on the DAG to define the order for the plurality of tasks occurs during the run-time phase.

5 . The method of claim 2 , further comprising performing loop detection during the build-time phase.

6 . The method of claim 2 , further comprising performing loop detection during the run-time phase.

7 . The method of claim 1 , wherein the allocating the plurality of computing threads comprises allocating the plurality of computing threads up to a thread limit for the first tenant.

8 . The method of claim 1 , wherein loading the plurality of tasks in the tenant-specific priority queue in the order determined by the topological sorting of the plurality of tasks occurs during a run-time phase.

9 . The method of claim 1 , wherein the performing topological sorting of the plurality of tasks comprises performing topological sorting using a Khan's BFS based algorithm.

10 . The method of claim 1 , wherein the allocating the plurality of computing threads from the multiple computing threads to execute the plurality of tasks comprises:

allocating a first computing thread of the plurality of computing threads to execute a first task;

continuously allocating another computing thread of the plurality of computing threads to execute a different task after a prior computing thread begins executing one of the plurality of tasks until each of the plurality of computing threads has been allocated to execute one of the plurality of tasks or there are no tasks available for executing; and

allocating a same or new computing thread for task execution upon successful or failed completion of one of the plurality of tasks.

11 . The method of claim 1 , wherein the executing the plurality of tasks using the plurality of computing threads that were allocated comprises for each computing thread of the plurality of computing threads:

selecting a first task in the tenant-specific priority queue for execution;

determining if the first task is ready for execution;

if ready, executing the first task and removing the first task from the tenant-specific priority queue so that there is a new first task in the tenant-specific priority queue; and

if not ready: selecting a next task in the tenant-specific priority queue for execution, determining if the next task is ready for execution, and if the next task is ready for execution, executing the next task and removing the next task from the tenant-specific priority queue, and if the next task is not ready for execution, repeatedly selecting a new next task in the tenant-specific priority queue and determining if ready until a task is selected that is ready for execution.

12 . The method of claim 11 , wherein the executing the plurality of tasks using the plurality of computing threads that were allocated comprises for each computing thread of the plurality of computing threads:

determining if task execution failure occurred; and

returning a failed task to a front of the tenant-specific priority queue for execution by a computing thread of the plurality of computing threads when task execution failure occurred with the failed task.

13 . The method of claim 12 , further comprising re-executing the failed task up to three times.

14 . A multi-tenant computing environment configured to provide an application for use by a first tenant, the multi-tenant computing environment comprises:

a multi-tenant database for storing tenant data for a plurality of tenants for use with the application; and

a server comprising one or more processors that provide multiple computing threads for use in application start-up and an application startup controller;

wherein the application startup controller is configured to:

write application code to utilize parallel processing to speed up application loading at the application start-up for the application, wherein writing the application code comprises selecting an application plan for the application loading at the application start-up, wherein selecting the application plan comprises identifying a plurality of jobs to be executed to load the application at the application start-up and identifying a plurality of tasks within each of the plurality of jobs;

generate, for a first tenant, a directed acyclic graph (DAG) for the plurality of tasks to be executed to load the application at the application start-up, wherein the DAG comprises a plurality of nodes, wherein each of the plurality of nodes corresponds to a task of the plurality of tasks to be executed to load the application at the application start-up;

perform topological sorting of the plurality of tasks to be executed to load the application at the application start-up based on the DAG to define an order for the plurality of tasks, wherein to perform the topological sorting of the plurality of tasks to be executed to load the application at the application start-up the application startup controller is configured to:

(a) identify a node of the DAG with zero indegree, wherein the identified node corresponds to a unique task of the plurality of tasks to be executed to load the application at the application start-up;

(b) store the unique task of the plurality of tasks to be executed to load the application at the application start-up corresponding to the node with zero indegree in a stack and delete the node with zero indegree from the DAG;

(c) delete edges originating from the node with zero indegree from the DAG; and

(d) repeat operations (a) through (c) until no nodes with zero indegree are left in the DAG;

allocate from the multi-tenant computing environment a tenant-specific priority queue for the first tenant;

load the plurality of tasks to be executed to load the application at the application start-up in the tenant-specific priority queue in the order determined by the topological sorting of the plurality of tasks to be executed to load the application at the application start-up;

allocate a plurality of computing threads from the multiple computing threads to execute the plurality of tasks;

cause the plurality of computing threads that were allocated to execute the plurality of tasks, wherein multiple tasks of the plurality of tasks are executed in parallel, and the plurality of tasks are assigned to the plurality of computing threads in an order based on the order in which the plurality of tasks are loaded in the tenant-specific priority queue;

cause a start page for use in accessing the application to be prepared; and

cause the start page to be displayed on a user access device for accessing the application.

15 . The multi-tenant computing environment of claim 14 , wherein to execute the plurality of tasks, each computing thread of the plurality of computing threads:

selects a first task in the tenant-specific priority queue for execution;

determines if the first task is ready for execution;

if ready, executes the first task and removes the first task from tenant-specific priority queue so that there is a new first task in the tenant-specific priority queue; and

if not ready: selects a next task in the tenant-specific priority queue for execution, determines if the next task is ready for execution, and if the next task is ready for execution, executing the next task and removing the next task from the tenant-specific priority queue, and if the next task is not ready for execution, repeatedly selecting a new next task in the tenant-specific priority queue and determining if ready until a task is selected that is ready for execution.

16 . The multi-tenant computing environment of claim 14 , wherein to execute the plurality of tasks, each computing thread of the plurality of computing threads:

determines if task execution failure occurred; and

returns a failed task to a front of the tenant-specific priority queue for execution by a computing thread of the plurality of computing threads when task execution failure occurred with the failed task.

17 . A method comprising a registration phase, a build-time phase, and a run-time phase, wherein the registration phase occurs when a tenant organization registers for access to an application, the build-time phase occurs before a user-request to access the application, and the run-time phase occurs after the user-request to access the application, the method comprising:

writing application code to utilize parallel processing to speed up application loading at application start-up for the application accessible via a multi-tenant computing environment that includes multiple computing threads, wherein writing the application code comprises selecting an application plan for the application loading at the application start-up, wherein selecting the application plan comprises identifying a plurality of jobs to be executed to load the application at the application start-up and identifying a plurality of tasks within each of the plurality of jobs;

generating, for a first tenant during the registration phase, a directed acyclic graph (DAG) for the plurality of tasks to be executed to load the application at the application start-up, wherein the DAG comprises a plurality of nodes, wherein each of the plurality of nodes corresponds to a task of the plurality of tasks to be executed to load the application at the application start-up;

performing topological sorting of the plurality of tasks to be executed to load the application at the application start-up based on the DAG to define an order for the plurality of tasks, wherein performing the topological sorting of the plurality of tasks to be executed to load the application at the application start-up comprises:

(a) identifying a node of the DAG with zero indegree, wherein the identified node corresponds to a unique task of the plurality of tasks to be executed to load the application at the application start-up;

(b) storing the unique task of the plurality of tasks to be executed to load the application at the application start-up corresponding to the node with zero indegree in a stack and deleting the node with zero indegree from the DAG;

(c) deleting edges originating from the node with zero indegree from the DAG; and

(d) repeating operations (a) through (c) until no nodes with zero indegree are left in the DAG;

allocating from the multi-tenant computing environment a tenant-specific priority queue for the first tenant;

loading the plurality of tasks to be executed to load the application at the application start-up in the tenant-specific priority queue in the order determined by the topological sorting of the plurality of tasks to be executed to load the application at the application start-up;

allocating a plurality of computing threads from the multiple computing threads to execute the plurality of tasks;

executing the plurality of tasks using the plurality of computing threads that were allocated, wherein multiple tasks of the plurality of tasks are executed in parallel, and the plurality of tasks are assigned to the plurality of computing threads in an order based on the order in which the plurality of tasks are loaded in the tenant-specific priority queue;

preparing a start page for use in accessing the application; and

causing the start page to be displayed on a user access device for accessing the application.

18 . The method of claim 17 , further comprising performing loop detection during the build-time phase.

19 . The method of claim 17 , further comprising performing loop detection during the run-time phase.

20 . The method of claim 17 , wherein the executing the plurality of tasks using the plurality of computing threads that were allocated comprises for each computing thread of the plurality of computing threads:

selecting a first task in the tenant-specific priority queue for execution;

determining if the first task is ready for execution;

if ready, executing the first task and removing the first task from the tenant-specific priority queue so that there is a new first task in the tenant-specific priority queue; and

if not ready: selecting a next task in the tenant-specific priority queue for execution, determining if the next task is ready for execution, and if the next task is ready for execution, executing the next task and removing the next task from the tenant-specific priority queue, and if the next task is not ready for execution, repeatedly selecting a new next task in the tenant-specific priority queue and determining if ready until a task is selected that is ready for execution.