IP Library Granted Patent US 9,772,878
Granted Patent B2
US 9,772,878 · App. 15/192,309 · Granted Sep 26, 2017

Determining a job group status based on a relationship between a generation counter value and a ticket value for scheduling the job group for execution

Inventor: Benoit Sevigny (Montréal, CA)
Assignee: Unity IPR ApS
G06F9/4881G06F9/5044
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 9,772,878
App. No.
15/192,309
Granted
Sep 26, 2017
Kind
B2
Abstract

A job scheduler system includes one or more hardware processors, a memory including a job group queue stored in the memory, and a job scheduler engine configured to create a first job group in the job group queue, the first job group includes a generation counter having an initial value, receive a first request to steal the first job group, determine a state of the first job group based at least in part on the generation counter, the state indicating that the first job group is available to steal, based on the determining the state of the first job group, atomically increment the generation counter, thereby making the first job group unavailable for stealing, and alter an execution order of the first job group ahead of at least one other job group in the job group queue.

Claims (79)

1. A job scheduler system comprising:

one or more hardware processors; and

a job scheduler engine having a memory and an execution stack,

wherein the memory includes a job group queue,

wherein the job group queue includes a plurality of job groups, each job group of the plurality of job groups includes one or more jobs for execution by the one or more hardware processors, and each job group includes an associated generation counter that is used, at least in part, to track a state of the associated job group, wherein the state identifies when the job group has been dequeued or stolen and the job group is in one of three places: (i) on the execution stack, (ii) waiting to get on the execution stack, (iii) being executed,

wherein the job scheduler engine, executable by the one or more hardware processors, is configured to perform operations comprising:

creating a first job group in the job group queue for an application submitting the first job group to be executed, the first job group includes a generation counter identifying one or more of an initial generation count value when the job group is considered available to steal and a finish generation count value when the first job group is considered finished;

transmitting a ticket associated with the first job group to the application, the ticket includes a ticket value for the first job group, the ticket value is associated with the generation counter of the first job group, the ticket value identifying the finish generation count value at which the first job group is considered finished;

receiving a first request to steal the first job group;

determining a state of the first job group based at least in part on the generation counter value, the state indicating that the first job group is available to steal when the generation counter value is two values or more different than the ticket value;

based on determining the state of the first job group is available for stealing, atomically updating the generation counter value to be one value or more different than the ticket value, thereby making the first job group unavailable for stealing;

based on atomically updating the generation counter value, altering an execution order of the first job group ahead of at least one other job group in the job group queue; and

based on finishing the execution of the first job group by the one or more hardware processors, updating the generation counter value to be the same as the ticket value.

2. The job scheduler system of claim 1 , wherein the first job group includes a first job list identifying a first plurality of jobs, wherein said altering further includes sending the first plurality of jobs to the execution stack, the one or more hardware processors are configured to execute jobs from the execution stack.

3. The job scheduler system of claim 2 , wherein sending the first plurality of jobs to the execution stack further includes removing the first plurality of jobs from the first job group, thereby making the first job list empty, wherein the job scheduler engine is further configured to perform operations comprising:

receiving a second request to steal the first job group approximately contemporaneously with the first request;

based on receiving the second request, determining a state of the first job group based at least in part on the generation counter value, the state indicating that the first job group is available to steal; and

failing to steal the first job group for the second request based on the first job list being empty.

4. The job scheduler system of claim 1 , wherein the first job group is dependent upon a second job group, wherein the first job group includes a first job list and the second job group includes a second job list, wherein the job scheduler engine is further configured to perform operations comprising:

determining that the first job group is dependent upon the second job group; and

based on the determining that the first job group is dependent upon the second job group:

adding the first job list to the end of the second job list; and

initiating a steal operation for the second job group.

5. The job scheduler system of claim 1 , wherein the first job group occupies a first region in the memory, wherein the first job group includes a first job list, wherein the job scheduler engine is further configured to perform operations comprising:

sending the first job list to the execution stack;

deleting the contents of the first job group; and

reusing the first job group for another job group without deallocating the first region in the memory.

6. The job scheduler system of claim 1 , wherein the job scheduler engine is further configured to perform operations comprising:

determining that the first job group has been executed; and

based on the determining that the first job group has been executed, atomically updating the generation counter value.

7. The job scheduler system of claim 1 , wherein processing the first request to steal the first job group does not use a waiting lock on the job group queue.

8. A computer-implemented method comprising:

creating a first job group in a job group queue for an application submitting the first job group to be executed, the job group queue is stored in a memory, the job group queue includes a plurality of job groups in the memory, each job group of the plurality of job groups includes one or more jobs for execution by the one or more hardware processors, and each job group includes an associated generation counter that is used, at least in part, to track a state of the associated job group, wherein the state identifies when the job group has been dequeued or stolen and the job group is in one of three places: (i) on an execution stack, (ii) waiting to get on the execution stack, (iii) being executed, the first job group includes a generation counter identifying one or more of an initial generation count value when the job group is considered available to steal and a finish generation count value when the first job group is considered finished;

transmitting a ticket associated with the first job group to the application, the ticket includes a ticket value for the first job group, the ticket value is associated with the generation counter of the first job group, the ticket value identifying the finish generation count value at which the first job group is considered finished;

receiving a first request to steal the first job group;

determining a state of the first job group based at least in part on the generation counter value, the state indicating that the first job group is available to steal when the generation counter value is two values or more different than the ticket value;

based on determining the state of the first job group is available for stealing, atomically updating the generation counter value to be one value or more different than the ticket value, thereby making the first job group unavailable for stealing;

based on atomically updating the generation counter value, altering an execution order of the first job group ahead of at least one other job group in the job group queue; and

based on finishing the execution of the first job group by the one or more hardware processors, updating the generation counter value to be the same as the ticket value.

9. The method of claim 8 , wherein the first job group includes a first job list, wherein altering further includes sending the first job list to the execution stack, the one or more hardware processors are configured to execute jobs from the execution stack.

10. The method of claim 9 , wherein sending the first plurality of jobs to the execution stack further includes removing the first plurality of jobs from the first job group, thereby making the first job list empty, the method further comprising:

receiving a second request to steal the first job group approximately contemporaneously with the first request;

based on receiving the second request, determining a state of the first job group based at least in part on the generation counter value, the state indicating that the first job group is available to steal; and

failing to steal the first job group for the second request based on the first job list being empty.

11. The method of claim 8 , wherein the first job group is dependent upon a second job group, wherein the first job group includes a first job list and the second job group includes a second job list, the method further comprising:

determining that the first job group is dependent upon the second job group; and

based on the determining that the first job group is dependent upon the second job group:

adding the first job list to the end of the second job list; and

initiating a steal operation for the second job group.

12. The method of claim 8 , wherein the first job group occupies a first region in the memory, wherein the first job group includes a first job list, the method further comprising:

sending the first job list to the execution stack;

deleting the contents of the first job group; and

reusing the first job group for another job group without deallocating the first region in the memory.

13. The method of claim 8 , further comprising:

determining that the first job group has been executed; and

based on the determining that the first job group has been executed, atomically updating the generation counter value.

14. The method of claim 8 , wherein processing the first request to steal the first job group does not use a waiting lock on the job group queue.

15. A non-transitory machine-readable medium storing processor-executable instructions which, when executed by a processor, cause the processor to perform operations comprising:

creating a first job group in a job group queue for an application submitting the first job group to be executed, the job group queue is stored in a memory, the job group queue includes a plurality of job groups in the memory, each job group of the plurality of job groups identifies one or more jobs for execution by the one or more hardware processors, and each job group includes an associated generation counter that is used, at least in part, to track a state of the associated job group, wherein the state identifies when the job group has been dequeued or stolen and the job group is in one of three places: (i) on an execution stack, (ii) waiting to get on the execution stack, (iii) being executed, the first job group includes a generation counter identifying one or more of an initial generation count value when the job group is considered available to steal and a finish generation count value when the first job group is considered finished;

transmitting a ticket associated with the first job group to the application, the ticket includes a ticket value for the first job group, the ticket value is associated with the generation counter of the first job group, the ticket value identifying the finish generation count value at which the first job group is considered finished;

receiving a first request to steal the first job group;

determining a state of the first job group based at least in part on the generation counter value, the state indicating that the first job group is available to steal when the generation counter value is two values or more different than the ticket value;

based on determining the state of the first job group is available for stealing, atomically updating the generation counter value to be one value or more different than the ticket value, thereby making the first job group unavailable for stealing;

based on atomically updating the generation counter value, altering an execution order of the first job group ahead of at least one other job group in the job group queue; and

based on finishing the execution of the first job group by the one or more hardware processors, updating the generation counter value to be the same as the ticket value.

16. The machine-readable medium of claim 15 , wherein the first job group includes a first job list, wherein altering further includes sending the first job list to the execution stack, the one or more hardware processors are configured to execute jobs from the execution stack.

17. The machine-readable medium of claim 15 , wherein the first job group is dependent upon a second job group, wherein the first job group includes a first job list and the second job group includes a second job list, wherein the processor-executable instructions further cause the processor to perform operations comprising:

determining that the first job group is dependent upon the second job group; and

based on the determining that the first job group is dependent upon the second job group:

adding the first job list to the end of the second job list; and

initiating a steal operation for the second job group.

18. The machine-readable medium of claim 15 , wherein the first job group occupies a first region in the memory, wherein the first job group includes a first job list, wherein the processor-executable instructions further cause the processor to perform operations comprising:

sending the first job list to the execution stack;

deleting the contents of the first job group; and

reusing the first job group for another job group without deallocating the first region in the memory.

19. The machine-readable medium of claim 15 , wherein the processor-executable instructions further cause the processor to perform operations comprising:

determining that the first job group has been executed; and

based on the determining that the first job group has been executed, atomically updating the generation counter value.

20. The machine-readable medium of claim 15 , wherein processing the first request to steal the first job group does not use a waiting lock on the job group queue.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 23, 2025
From: UNITY IPR APS
To: UNITY TECHNOLOGIES APS
Reel/Frame 072926/0322 →
CORRECTIVE ASSIGNMENT TO CORRECT THE CITY OF ASSIGNEE PREVIOUSLY RECORDED ON REEL 041330 FRAME 0203. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jul 27, 2017
From: SEVIGNY, BENOIT
To: UNITY IPR APS
Reel/Frame 043941/0581 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 22, 2017
From: SEVIGNY, BENOIT
To: UNITY IPR APS
Reel/Frame 041330/0203 →
Continuity (2)
Provisional Application 62252897 · Nov 9, 2015
Related Publication 20170132037A1 · May 11, 2017