Synchronous operation method performance in context of asynchronous event loop

US2019324783A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2019324783-A1
Application numberUS-201815959600-A
CountryUS
Kind codeA1
Filing dateApr 23, 2018
Priority dateApr 23, 2018
Publication dateOct 24, 2019
Grant date

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A synchronous operation method receives a call request from program code executing on an execution engine. The program code has an associated event loop handling asynchronous event calls and callbacks within the program code. Handlers of the event loop associated with the asynchronous event calls and the callbacks within the program code, except a handler of the event loop associated with the synchronous operation method, are temporarily disabled. The synchronous operation method performs an operation specified within the call request, while the event loop is running with the handlers in question temporarily disabled. The synchronous operation method, upon completion, calls back its handler with results of performance of the operation, and the disabled handlers are reenabled.

First claim

Opening claim text (preview).

1 . A method comprising: receiving, by a synchronous operation method from program code executing within an asynchronous program code execution environment on an execution engine running on a computing device, a call request, the program code having an associated event loop handling asynchronous event calls and callbacks within the program code; temporarily disabling, by the synchronous operation method, a plurality of handlers of the event loop associated with the asynchronous event calls and the callbacks within the program code, except a handler of the event loop associated with the synchronous operation method; performing, by the synchronous operation method, an operation specified within the call request received from the program code, while the event loop is running with the handlers associated with the asynchronous event calls and the callbacks, except the handler associated with the synchronous operation method, being temporarily disabled; and upon completion of the operation, calling back, by the synchronous operation method, the handler of the event loop associated with the synchronous operation method, with results of performance of the operation, and reenabling the handlers associated with the asynchronous event calls and the callbacks within the program code. 2 . The method of claim 1 , wherein the execution engine runs on the computing device as a single thread within which the event loop is run. 3 . The method of claim 2 , wherein the synchronous operation method runs within the single thread, conserving usage of resources of the computing device in synchronous execution of the operation relative to having the synchronous operation method run in a different thread. 4 . The method of claim 2 , wherein the single thread is associated with a single virtual user. 5 . The method of claim 4 , wherein association of the single thread with the single virtual user isolates the event loop running within the single thread from other event loops of other virtual users. 6 . The method of claim 1 , wherein temporarily disabling of the handlers of the event loop ensures synchronous performance of the operation specified within the call request relative to the program code. 7 . The method of claim 1 , wherein the operation specified within the call request is a network operation, wherein at beginning execution of the program code a network connection is established for the program code, wherein the synchronous operation method uses the established network connection to perform the operation specified within the call request. 8 . The method of claim 7 , wherein usage of the established network connection by the synchronous operation method to perform the operation specified within the call request conserves usage of resources of the computing device in synchronous execution of the operation relative to having the synchronous operation method use a different network connection. 9 . The method of claim 1 , further comprising, while the synchronous operation method is performing the operation and the event loop is running with the handlers associated with the asynchronous event calls and the callbacks, except the handler associated with the synchronization operation method, being temporarily disabled: receiving the asynchronous event calls and the callbacks with which the handlers are associated; and placing the received asynchronous event calls and the received callbacks within a pending queue, the handlers remaining temporarily disabled and unable to process the received asynchronous event calls and the received callbacks. 10 . The method of claim 9 , further comprising, upon reenabling of the handlers associated with the asynchronous event calls and the callbacks: processing, by the reenabled handlers, the received asynchronous event calls and the received callbacks previously placed within the pending queue. 11 . The method of claim 9 , wherein while the synchronous operation method is performing the operation, the execution engine continues to execute the program code by passing the asynchronous event calls to the event loop, but the handlers associated with the asynchronous event calls, having been temporarily disabled, block processing of the asynchronous event calls within the event loop, ensuring synchronous performance of the operation specified within the call request relative to the program code. 12 . The method of claim 1 , wherein the program code is JavaScript program code, the execution engine is a JavaScript code engine, and the event loop is a libuv library event loop, and wherein the program code, the execution engine, and the event loop are part of a Node.js framework. 13 . A non-transitory computer-readable data storage medium storing instructions executable by a processor to: initiate execution of program code via an execution engine, the execution of the program code performed in relation to an event loop associated with the program code and providing for asynchronous operations of the program code within an asynchronous program code execution environment; responsive to encountering a call request to a synchronous operation method within the program code, temporarily disable a plurality of handlers of the event loop that provide for the asynchronous operations of the program code, except for an event handler associated with the synchronous operation method; after the handlers that provide for the asynchronous operations have been disabled, except for the handler associated with the synchronous operation method, perform the call request to the synchronous operation method, the synchronous operation method executing while the event handlers remain temporarily disabled; and while the event handlers remain temporarily disabled, placing event calls and callbacks to the temporarily disabled handlers within a pending queue until the synchronous operation method has completed executing. 14 . The non-transitory computer-readable data storage medium of claim 13 , wherein the instructions are executable by the processor to further: responsive to a callback to the event handler associated with the synchronous operation method, signifying completion of the synchronous operation method, reenabling the temporarily disabled handlers and passing the event calls and the callbacks placed within the queue to the reenabled handlers for processing. 15 . The non-transitory computer-readable data storage medium of claim 13 , wherein the execution engine runs as a single thread within which the event loop is run, conserving usage of resources of the computing device in synchronous execution of the operation relative to having the synchronous operation method run in a different thread, and wherein the single thread is associated with a single virtual user, isolating the event loop running within the single thread from other event loops of other virtual users. 16 . The non-transitory computer-readable data storage medium of claim 13 , wherein the synchronous operation method is a synchronous network operation method, wherein at initiation of execution of the program code a network connection is established for the program code, and wherein the synchronous network operation method uses the established network connection, conserving usage of resources of the computing device in performance of the synchronous operation method. 17 . A system comprising: a processor; and a memory storing instructions executable by the processor to: encounter a call request to a synchronous operation method within program code executing within an asynchronous program code

Assignees

Inventors

Classifications

  • G06F9/542Primary

    Event management; Broadcasting; Multicasting; Notifications · CPC title

  • Program synchronisation; Mutual exclusion, e.g. by means of semaphores · CPC title

  • Optimisation or modification within the same instruction set architecture, e.g. HP Dynamo · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US2019324783A1 cover?
A synchronous operation method receives a call request from program code executing on an execution engine. The program code has an associated event loop handling asynchronous event calls and callbacks within the program code. Handlers of the event loop associated with the asynchronous event calls and the callbacks within the program code, except a handler of the event loop associated with the s…
Who is the assignee on this patent?
Entit Software Llc
What technology area does this patent fall under?
Primary CPC classification G06F9/542. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu Oct 24 2019 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).