# US 10,310,820 B2 · Programming model and interpreted runtime environment for high performance services with implicit concurrency control

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,310,820 B2
- Document ID: US10310820B2
- Status: Granted
- Kind: B2
- Application number: 15/592,061
- Filed: 2017-05-10
- Published: 2017-11-16
- Granted: 2019-06-04
- Earliest claimed: 2016-05-12
- Assignees: Basal Nuclei Inc
- Applicants: Basal Nuclei Inc.
- Inventors: Ahmet Salih Iscen
- Web page: https://patentgrep.com/patent/US10310820B2

## CPC

- G06F 8/31: {Programming languages or programming paradigms}
- G06F 8/315: {Object-oriented languages}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/4482: {Procedural}
- G06F 9/4488: {Object-oriented}
- G06F 9/45508: {Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation}
- G06F 9/4831: {with variable priority}
- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed is a programming model utilized for the definition of services to be operated on large sets of data with numerous responsibilities, the programming model comprising program units in a tree topology for high performance and implicit concurrency control, where each program unit definition comprises responsibilities defined in behaviors and configurations. A runtime environment may be utilized to provide implicit concurrency, parallelization, and concurrency control for operations executed on program unit instances.

## Claims

### Claim 1

A method of computing to provide implicit concurrency control, comprising:
within a runtime environment process, scheduling a task on a thread to execute an operation based on a priority on a program unit instance (PUI) of a program unit definition (PUD);
enqueueing the task into a task stream of the thread, wherein the PUI comprises an identifier, wherein the task stream comprises a flag, the identifier of the PUI, and a queue of tasks in a priority order each comprising the identifier of the PUI, and wherein the flag is set to “true” to mark the task stream as blocked, and set to “false” to mark the task stream as unblocked;
prioritizing the tasks located at the head of the queue of tasks of the task streams marked as unblocked in the thread; and
dequeuing and executing a highest priority task in the thread,
wherein executing the highest priority task in the thread includes:
applying a concurrency control algorithm corresponding to a concurrency control type of the PUD for the operation to determine whether to set the flag value of one or more task streams to “true”;
executing the operation on the PUI; and
applying the concurrency control algorithm to determine whether to set the flag value of one or more task streams to “false”.

### Claim 2 (depends on 1)

The method of claim 1, wherein scheduling the task on the thread is indicated by mapping the identifier of the PUI to an identifier of the thread.

### Claim 3 (depends on 1)

The method of claim 1, wherein the concurrency control type includes one of no concurrency control, mutual exclusion, semaphore or readers/writers lock, and wherein the corresponding concurrency control algorithm includes one of no concurrency control algorithm, mutual exclusion algorithm, semaphore algorithm or readers/writers lock algorithm.

### Claim 4 (depends on 1)

The method of claim 1, wherein the PUI further includes a private state,
wherein the private state includes at least one of a memory state, a persisted state on a storage medium, a memory state on a remote computing unit, a persisted state on a storage medium on a remote computing unit, a state of an apparatus, or a state of a remote apparatus,
wherein the private state is accessed by the execution of the operation on the PUI, and
wherein the remote computing unit is one of a physical computer, a virtual computer, a container, or an embedded computer.

### Claim 5 (depends on 1)

The method of claim 1, wherein the operation includes at least one of creating the PUI of the PUD with a new identifier, executing a native function on the PUI, executing an interpreted function of the PUD on the PUI with an interpreter, deleting the PUI, further scheduling the task on a thread pool, or further scheduling the task on the thread indicated via mapping the identifier of the PUI to the identifier of the thread, and
wherein the interpreted function includes an interpreted instruction specified in an interpreted language.

### Claim 6 (depends on 5)

The method of claim 5, wherein the interpreted instruction is specified in either continuation-passing style (CPS) or direct-style (DS),
wherein, if specified in CPS:
the interpreted instruction specified in CPS a call to a CPS function, wherein the CPS function takes an extra argument to an explicit continuation function, and wherein the explicit continuation function the interpreted instruction and is executed in the thread; and
the execution of the operation comprising the execution of the interpreted function comprising the interpreted instruction specified in CPS completes upon the completion of the execution of the interpreted function and the completion of the execution of every explicit continuation function called during the execution of the operation in the thread.

### Claim 7 (depends on 5)

The method of claim 5, further comprising executing the operation in a coroutine execution context.

### Claim 8 (depends on 7)

The method of claim 7, further comprising, with an implicit promise function returning an implicit future value, providing implicit concurrency with implicit concurrency control to the execution of the operation in the coroutine execution context executing the interpreted function,
wherein a call to the implicit promise function includes scheduling a concurrent execution of the implicit promise function, returning an unresolved implicit future value and proceeding with the execution of the operation in the coroutine execution context;
wherein the execution of the operation implicitly yields the execution to dequeue and execute the highest priority task in the thread at the execution of the interpreted instruction that accesses the unresolved implicit future value; and
wherein the previously yielded execution of the operation is restored and the implicit future value is resolved with the completion of the concurrent execution of the implicit promise function.

### Claim 9

An apparatus to provide implicit concurrency control within a runtime environment process, comprising:
at least one memory; and
at least one processor,
the at least one processor to:
schedule a task on a thread to execute an operation based on a priority on a program unit instance (PUI) of a program unit definition (PUD);
enqueue the task into a task stream of the thread, wherein the PUI includes an identifier, wherein the task stream includes a flag, the identifier of the PUI, and a queue of tasks in a priority order each comprising the identifier of the PUI, and wherein the flag is set to “true” to mark the task stream as blocked, and set to “false” to mark the task stream as unblocked;
prioritize the tasks located at the head of the queue of tasks of the task streams marked as unblocked in the thread; and
dequeue and execute a highest priority task in the thread,
wherein to execute the highest priority task in the thread includes to:
apply a concurrency control algorithm corresponding to a concurrency
control type of the PUD for the operation to determine whether to set the flag value of one or more task streams to “true”;
execute the operation on the PUI; and
apply the concurrency control algorithm to determine whether to set the flag value of one or more task streams to “false”.

### Claim 10 (depends on 9)

The apparatus of claim 9, wherein the apparatus is further to schedule the task on the thread indicated via mapping the identifier of the PUI to an identifier of the thread.

### Claim 11 (depends on 9)

The apparatus of claim 9, wherein the concurrency control type includes one of no concurrency control, mutual exclusion, semaphore or readers/writers lock, and wherein the corresponding concurrency control algorithm includes one of no concurrency control algorithm, mutual exclusion algorithm, semaphore algorithm or readers/writers lock algorithm.

### Claim 12 (depends on 9)

The apparatus of claim 9, wherein the PUI further includes a private state, the private state including at least one of a memory state, a persisted state on a storage medium, a memory state on a remote computing unit, a persisted state on a storage medium on a remote computing unit, a state of an apparatus, or a state of a remote apparatus,
wherein the private state is accessed by the execution of the operation on the PUI, and
wherein the remote computing unit is a physical computer, a virtual computer, a container, or an embedded computer.

### Claim 13 (depends on 9)

The apparatus of claim 9, wherein the operation includes at least one of creating the PUI of the PUD with a new identifier, executing a native function on the PUI, executing an interpreted function of the PUD on the PUI with an interpreter, deleting the PUI, further scheduling the task on a thread pool, or further scheduling the task on the thread indicated via mapping the identifier of the PUI to the identifier of the thread, and
wherein the interpreted function includes an interpreted instruction specified in an interpreted language.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein the interpreted instruction is specified in either continuation-passing style (CPS) or in direct-style (DS), and
wherein, if specified in CPS:
the interpreted instruction includes a call to a CPS function, the CPS function takes an extra argument to an explicit continuation function, the explicit continuation function includes the interpreted instruction, and the apparatus is further to execute the explicit continuation function in the thread; and
wherein the apparatus is further to:
complete the execution of the operation including the execution of the interpreted function including the interpreted instruction upon the completion of the execution of the interpreted function and the completion of the execution of every explicit continuation function called during the execution of the operation in the thread.

### Claim 15 (depends on 13)

The apparatus of claim 13, wherein the apparatus is further to execute the operation in a coroutine execution context.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the apparatus is further to:
with an implicit promise function returning an implicit future value, provide implicit concurrency with implicit concurrency control to the execution of the operation in the coroutine execution context executing the interpreted function,
wherein a call to the implicit promise function includes to schedule a concurrent execution of the implicit promise function, return an unresolved implicit future value and proceed with the execution of the operation in the coroutine execution context;
wherein the execution of the operation implicitly yields the execution to dequeue and execute the highest priority task in the thread at the execution of the interpreted instruction that accesses the unresolved implicit future value; and
wherein the previously yielded execution of the operation is restored and the implicit future value is resolved with the completion of the concurrent execution of the implicit promise function.

### Claim 17

A non-transitory computer-readable storage medium storing instructions that when executed by a computer cause the computer to provide implicit concurrency control to executions of operations over program unit instances of program unit definitions, including to:
within a runtime environment process, schedule a task on a thread to execute an operation based on a priority on a program unit instance (PUI) of a program unit definition (PUD);
enqueue the task into a task stream of the thread, wherein the PUI includes an identifier, wherein the task stream includes a flag, the identifier of the PUI, and a queue of tasks in a priority order each comprising the identifier of the PUI, and wherein the flag is set to “true” to mark the task stream as blocked, and set to “false” to mark the task stream as unblocked;
prioritize the tasks located at the head of the queue of tasks of the task streams marked as unblocked in the thread; and
dequeue and execute a highest priority task in the thread,
wherein to execute the highest priority task in the thread includes:
apply a concurrency control algorithm corresponding to a concurrency control type of the PUD for the operation to determine
whether to set the flag value of one or more task streams to “true”;
execute the operation on the PUI; and
apply the concurrency control algorithm to determine whether to set the flag value of one or more task streams to “false”.

### Claim 18 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the instructions, when executed, further cause the computer to schedule the task on the thread indicated via mapping the identifier of the PUI to an identifier of the thread.

### Claim 19 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the concurrency control type includes one of no concurrency control, mutual exclusion, semaphore or readers/writers lock, and wherein the corresponding concurrency control algorithm includes one of no concurrency control algorithm, mutual exclusion algorithm, semaphore algorithm or readers/writers lock algorithm.

### Claim 20 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the PUI further includes a private state, wherein the private state includes at least one of a memory state, a persisted state on a storage medium, a memory state on a remote computing unit, a persisted state on a storage medium on a remote computing unit, a state of an apparatus, or a state of a remote apparatus;
wherein the private state is accessed by executing the operation on the PUI, and
wherein the remote computing unit is one of a physical computer, a virtual computer, a container, or an embedded computer.

### Claim 21 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the operation includes one of creating the PUI of the PUD with a new identifier, executing a native function on the PUI, executing an interpreted function of the PUD on the PUI with an interpreter, deleting the PUI, further scheduling the task on a thread pool, or further scheduling the task on the thread indicated via mapping the identifier of the PUI to the identifier of the thread, and
wherein the interpreted function includes an interpreted instruction specified in an interpreted language.

### Claim 22 (depends on 21)

The non-transitory computer-readable storage medium of claim 21, wherein the interpreted instruction is specified in either continuation-passing style (CPS) or direct-style (DS),
wherein, if specified in CPS:
the interpreted instruction includes a call to a CPS function, the CPS function takes an extra argument to an explicit continuation function, the explicit continuation function includes the interpreted instruction, and the apparatus is further to execute the explicit continuation function in the thread; and
wherein, when executed, the instructions further cause the computer to:
complete the execution of the operation including the execution of the interpreted function including the interpreted instruction upon the completion of the execution of the interpreted function and the completion of the execution of every explicit continuation function called during the execution of the operation in the thread.

### Claim 23 (depends on 21)

The non-transitory computer-readable storage medium of claim 21, wherein the instructions, when executed, further cause the computer to execute the operation in a coroutine execution context.

### Claim 24 (depends on 23)

The non-transitory computer-readable storage medium of claim 23, wherein the instructions, when executed, further cause the computer to:
with an implicit promise function returning an implicit future value, provide implicit concurrency with implicit concurrency control to the execution of the operation in the coroutine execution context executing the interpreted function,
wherein a call to the implicit promise function includes to schedule a concurrent execution of the implicit promise function, return an unresolved implicit future value and proceed with the execution of the operation in the coroutine execution context;
wherein the execution of the operation implicitly yields the execution to dequeue and execute the highest priority task in the thread at the execution of the interpreted instruction that accesses the unresolved implicit future value; and
wherein the previously yielded execution of the operation is restored and the implicit future value is resolved with the completion of the concurrent execution of the implicit promise function.
