In the field of computer software, software instructions can execute to direct a computing device to perform various tasks. Software instructions can be stored in a memory of a computing device and executed by a processor of the computing device. Related software instructions can be grouped together in their storage and execution. Such groupings are referred to by various names, such as a process, an application, a program, or other names.
Multiple groups of software instructions can sometimes run on the same computing device at the same time. For example, two different processes may both run simultaneously on one computer, taking turns being executed by the computer's processor. Further, multiple copies of the same group of software instructions can sometimes run on the same computing device at the same time. As an example, two copies of an application, each with their own set of data, may both run simultaneously on one computer, taking turns being executed by the computer's processor. Throughout this document, each running copy of a group of software instructions is referred to as an execution instance and the starting of the running is referred to as launching the execution instance.
In some situations it can be useful to prevent multiple execution instances from running simultaneously. For example, if a particular set of data can only be properly used by one program at a time, then it can be useful to prevent multiple execution instances of the program from running simultaneously. In a prior approach to these situations, a first execution instance of an application creates a lock file and subsequent execution instances check the lock file before launching. When the first execution terminates, it should remove the lock file. However, this prior approach can cause difficulties, such as naming conflicts, when other groups of software instructions use existing lock files. This prior approach also works poorly when a first execution instance creates a lock file/socket but terminates abnormally and fails to remove the lock file, thus inappropriately preventing other execution instances from launching.
Embodiments of the present disclosure include methods, computer readable media, systems, and computing devices are provided for controlling execution instances. A method embodiment includes maintaining in a counter of a database, a count associated with a particular number of execution instances of a application registered in the database. The method includes setting for the counter, an upper number associated with a particular number of execution instances of the application allowed to be registered in the database. The method also includes receiving to the database, a request from the application to launch an execution instance of the application. The method further includes transmitting from the database to the application, a response to the request, based on the count and the upper number.
The processor 107 represents a processing unit which can have various architectures. Embodiments of the disclosure can be implemented in a multi-processor or single processor computing system or device. Embodiments described herein can similarly be implemented in a distributed computing network environment, as the same are known and understood by one of ordinary skill in the art. The embodiments are not limited to the examples given herein.
The host bridge chipset 120 includes a number of interface circuits to allow the host processor 107 to access the system memory 130 and the PCI bus 145. The system memory 130 represents one or more mechanisms for storing information. For example, the system memory 130 may include non-volatile and/or volatile memories. Examples of these memories include flash memory, read only memory (ROM), random access memory (RAM), etc. The system memory 130 may be loaded with an operating system (OS) 131, e.g., in ROM. Examples of operating systems include, but are not limited to, Windows, Mac, Unix, Linux, etc. A basic input/output system (BIOS) is also stored in ROM in the system memory 130.
The system memory 130 further includes a memory management system 135, e.g., in RAM, and other programs and data 138. The system memory 130 may also contain additional software, such as processes or applications, as the same will be known and understood by one of ordinary skill in the art. The memory management system 135 includes elements in connection with software being executed by the processor 107. That is, as one of ordinary skill in the art will appreciate, the memory management system includes instructions for managing memory, memory data structures, etc.
The PCI slots 160-1 to 160-N provide interfaces to PCI devices. Examples of PCI devices can include printers, facsimiles, scanners, network interface devices, media interface devices, etc. Storage devices 172 can include floppy disks, CDs, hard drives, etc. Embodiments, however, are not limited to these examples.
In the kernel space 203, the system 200 includes a first kernel process 240-1, a second kernel process 240-2, an Nth kernel process 240-N, a module of kernel programming interfaces (KPIs) 250, and a kernel database 260. The system 200 is used in a system memory of a computing device (respectively referred to as “the memory” and “the computing device” in connection with the embodiment of
The user space 201 and the kernel space 203 are portions of the memory of the computing device. The user space 201 is a portion of the memory in which a user has more control over software than in the kernel space 203. In the user space 201, a user can select user applications, such as the user applications 210-1 through 210-N, to be launched or terminated. In the kernel space 203, software instructions can execute so that the kernel processes, such as the kernel processes 240-1 through 240-N, can launch, run, and terminate automatically, without direct control from a user. Various software instructions can execute to communicate between software elements in the user space 201 and software elements in the kernel space 203.
The user applications 210-1 through 210-N are software applications running in the user space 201. The user applications 210-1 through 210-N can be various types of software applications. For example, a user application can be a word processor, a spreadsheet, an e-mail application, a media player, etc. Although three user applications are shown in
The library of APIs 220 is a collection of groups of software instructions, with each group designed to perform one or more particular tasks. Software instructions can execute so that an API can facilitate an interface between groups of software instructions, such as applications, in the user space 201. For example, an API can facilitate an interface by providing a set of definitions. In this example, software instructions can execute so that the API can receive a communication from an application, redefine the communication by using the set of definitions, and transmit the redefined communication to another application. The library of APIs 220 is configured to communicate with the user applications 210-1 through 210-N and with the library of kernel system calls 230.
In the embodiment of
The library of kernel system calls 230 is also a collection of groups of software instructions, with each group designed to perform one or more particular tasks. Software instructions can execute so that a kernel system call can call for a particular task to be performed in the kernel space. The library of kernel system calls 230 is configured to communicate with the library of APIs 220 and with the module of KPIs 250. In the embodiment of
Software instructions can execute so that the kernel processes 240-1 through 240-N can also communicate with the module of KPIs 250. The kernel processes 240-1 through 240-N are software processes running in the kernel space 203. The kernel processes 240-1 through 240-N can be various types of kernel processes used to perform tasks in the kernel space 203 for an operating system, on behalf of user applications, or on behalf of other kernels. For example, software instructions can execute so that a kernel process can schedule software access to memory structures and hardware. Although three kernel processes are shown in
The module of KPIs 250 is a kernel module that includes groups of software instructions, with each group designed to perform one or more particular tasks. Software instructions can execute so that a KPI can facilitate an interface between groups of software instructions, such as processes, in the kernel space 203. For example, a KPI can facilitate an interface by providing a set of definitions and by executing software instructions so that the KPI can receive a communication from one process, redefine the communication by using the set of definitions, and transmit the redefined communication to another process. The module of KPIs 250 is configured to communicate with the library of kernel system calls 230, with the kernel processes 240-1 through 240-N, and with the kernel database 260. In the embodiment of
When the KPIs in the module of KPIs 250 are called by kernel system calls from the library of kernel system calls 230, software instructions can execute so that the KPIs in the module of KPIs 250 can also facilitate interfaces between the APIs in the library of APIs 220 and the kernel database 260. In various embodiments, the module of KPIs 250 can be associated with one or more of the kernel processes 240-1 through 240-N. For example, the kernel processes 240-1 through 240-N can be registered with the module of KPIs 250, as will be understood by one of ordinary skill in the art.
The kernel database 260 is a data structure which contains information about software on the computing device. The kernel database 260 includes information about execution instances for the user applications 210-1 through 210-N and the kernel processes 240-1 through 240-N. Software instructions can execute to modify the information in the kernel database 260. In various embodiments, these software instructions can be instructions in the kernel database 260, in KPIs, or in kernel processes, which may or may not be associated with the kernel database 260, the module of KPIs 250, and/or the kernel processes 240-1 through 240-N. The kernel database 260 is configured to communicate with the module of KPIs 250 and the client 270.
Software instructions can execute to use the kernel database 260 in the system 200 for controlling execution instances of software, such as the user applications 210-1 through 210-N and the kernel processes 240-1 through 240-N. In the embodiment of
Also in the embodiment of
Software instructions can execute to determine whether to grant or deny a request to launch a user application or a kernel process, as described in connection with the embodiment of
The client 270 is another computing device, different from the computing device which includes the memory with the user space 201 and the kernel space 203. The client 270 is configured to communicate with the kernel database 260. Although one client is shown in
At block 303, the method 300 includes setting a count equal to a number of application execution instances, in a particular category of software applications, which are running on the computing device. Software instructions can execute to set the count to equal the number of application execution instances which are running. In the embodiment of
In various embodiments of the present disclosure, software instructions can execute to set the count of block 303 as a count in an adjustable counter. For example, such a counter can be included in the kernel database 260, as described in connection with
In the setting of block 303, each application execution instance is considered separately, whether instances are from the same application or different applications. For example, if a first application is in a category of software applications and four execution instances of the first application are running on the computing device, then software instructions can execute to set the count at four to equal the total of four running application execution instances for the one application in the category. Also as an example, if a first application and a second application are in the same category of software applications, two execution instances of the first application are running on the computing device, and three execution instances of the second application are running on the same computing device, then software instructions can execute to set the count at five to equal the total of five running application execution instances for the two applications in the category.
In various embodiments, the count of block 303 can also be associated with a number of application execution instances, in a particular category of software applications, which are running on the computing device, without setting the count equal to the number. In some embodiments of the present disclosure, various algorithms can be applied to the count, so that the count represents the number of application execution instances without equaling the number of application execution instances, as will be understood by one of ordinary skill in the art. For example, an algorithm with a multiplying factor of two can be applied to the count, so that the count represents two times a number of application execution instances, in a particular category of software applications, which are running on the computing device. In this way, the count can be used to track the number of application execution instances without a one-for-one correspondence between the count and the number.
In some embodiments of the present disclosure, the count of block 303 can be associated with registrations for a number of application execution instances, which are running on the computing device. Software instructions can execute to register a number of application execution instances running simultaneously on the device. For example, software instructions can execute to perform these registrations by using a KPI, such as a KPI from the module of KPIs 250 in the embodiment of
The method 300 also includes, at block 307, setting an upper number equal to a number of application execution instances, in a particular category of software applications, which are allowed to run simultaneously on the computing device. Software instructions can execute to set the upper number of application execution instances which are allowed to run simultaneously. For example, software instructions can execute to set the upper number by using a KPI, such as a KPI from the module of KPIs 250 in the embodiment of
In some embodiments, the upper count number of block 307 can represent the number of allowable application execution instances without equaling the number of allowable application execution instances, as described above, in connection with the count of block 303. For example, software instructions can execute to set the upper number of block 307, to be associated with a number of application execution instances, in a particular category of software applications, which are allowed to run simultaneously on the computing device.
In various embodiments, the upper number of block 307 can be a fixed number or a variable number. The upper number can be fixed, for example, by a user of a user application in the particular category of software applications. The upper number can be variable, for example, based on resources available in the computing device. In this example, the upper number of execution instances can be reset based upon a change in availability of resources, such as memory, for simultaneously running application execution instances on the computing device. For instance, if less memory becomes available in the computing device, then the upper number can be reset to a lower value, to allow fewer application execution instances to run. Similarly, if more memory becomes available in the computing device, then the upper number can be reset to a higher value, to allow more application execution instances to run.
Block 313, wait, represents a connection point in the method 300. In the method 300, results from various elements direct the method to block 313, as depicted in
At block 315, the method 300 includes receiving a request from a software application to launch an execution instance of the software application. The software application can be a user application, such as the user applications 210-1 through 210-N in the embodiment of
The method 300 also includes, at element 323, a first decision regarding the request to launch received at block 315. At element 323, software instructions can execute to determine whether or not the application of the execution instance, for which the request to launch was received at block 315, belongs in the category, for which the count was set at block 303 and for which the upper number was set at block 307. Software instructions can execute to compare one or more characteristics of the application with one or more characteristics of the category, to determine whether or not the application belongs in the category. For example, if a category of software applications is defined by the characteristic of accessing a particular area of memory in the computing device, then software instructions associated with element 323 can execute to determine whether or not the application of the execution instance requesting launch also accesses the particular area of memory.
If software instructions associated with element 323 determine that the application of the execution instance requesting launch does not belong in the category (e.g. the “NO” output of element 323), then software instructions can execute to direct the method to block 313. If software instructions associated with element 323 determine that the application of the execution instance requesting launch belongs in the category (e.g. the “YES” output of element 323), then software instructions can execute to direct the method to element 333.
Element 333 includes a second decision regarding the request to launch received at block 315. Software instructions can execute to determine whether or not launching the requested application execution instance would cause the number of application execution instances in a category and running on the computing device, to exceed the number of application execution instances, which are allowed to run in the category and on the computing device. In the embodiment of
If software instructions associated with element 333 determine that launching the requested application execution instance would cause the count to exceed the upper number (e.g. the “YES” output of element 333), then software instructions can execute to direct the method to block 347. If software instructions associated with element 333 determine that launching the requested application execution instance would not cause the count to exceed the upper number (e.g. the “NO” output of element 333), then software instructions can execute to direct the method to block 343.
At block 343, the method 300 includes communicating a grant to the application from which the launch request was received at block 315. Software instructions can execute to communicate the grant in response to the launch request received at block 315. For example, the grant can be communicated by transmitting the grant from the kernel database 260 to the requesting application, as described in connection with
The method 300 also includes, at block 353, adding a registration for the execution instance of the application for which the request was received at block 315. Software instructions can execute to add the registration for the execution instance, in order to maintain registrations for application execution instances currently running on the computing device. For example, as described in connection with
Block 363 includes incrementing the count of block 303. Software instructions can execute to increment the count, in order to maintain an association between the count, originally set at block 303, and the number of currently running application execution instances in the category of blocks 303, 307, and 323, on the computing device. For example, software instructions can execute to increment the count so that the count is equal to the number of currently running application execution instances in a category of software applications. The incrementing of block 363 can be performed by software instructions, such as instructions in a KPI from the module of KPIs 250 as described in connection with
At block 373, the method 300 includes communicating information about the addition of the registration at block 353. As described in connection with
In various embodiments, additional information about execution instances can also be communicated to the client. For example, software instructions can execute to transmit to the client information about the number application instances currently running in a particular category, the existence of a particular category, etc. After the grant is communicated to the application at block 343, software instructions can execute to direct the method to block 313, to continue performing the method 300, as will be understood by one of ordinary skill in the art.
The method also includes, at block 347, communicating a denial to the application from which the launch request was received at block 315. Software instructions can execute to communicate the denial in response to the launch request received at block 315. For example, the denial can be communicated by transmitting the denial from the kernel database 260 to the requesting application, as described in connection with
Block 317 includes receiving a notification that a running execution instance of a software application terminated. The software application can be a user application, such as the user applications 210-1 through 210-N in the embodiment of
At element 325, the method 300 includes a decision regarding the notification received at block 317. At element 325, software instructions can execute to determine whether or not the application of the execution instance, for which the notification of termination was received at block 317, belongs in the category, for which the count was set at block 303 and for which the upper number was set at block 307. Software instructions can execute to compare one or more characteristics of the application with one or more characteristics of the category, to determine whether or not the application belongs in the category, as described in connection with element 323.
If software instructions associated with element 325 determine that the application of the execution instance requesting launch does not belong in the category (e.g. the “NO” output of element 325), then software instructions can execute to direct the method to block 313. If software instructions associated with element 325 determine that the application of the execution instance requesting launch belongs in the category (e.g. the “YES” output of element 325), then software instructions can execute to direct the method to block 357.
The method also includes, at block 357, removing a registration for the execution instance of the application for which the notification was received at block 317. Software instructions can execute to remove the registration for the execution instance, in order to maintain registrations for application execution instances currently running on the computing device. For example, as described in connection with
Block 367 includes decrementing the count of block 303. Software instructions can execute to decrement the count, in order to maintain an association between the count, originally set at block 303, and the number of currently running application execution instances in the category of blocks 303, 307, and 323, on the computing device. For example, software instructions can execute to decrement the count so that the count is equal to the number of currently running application execution instances in a category of software applications. The decrementing of block 367 can be performed by software instructions, such as instructions in a KPI from the module of KPIs 250 as described in connection with
At block 377, the method 300 includes communicating information about the removal of the registration at block 357. As described in connection with block 373, a client can be another computing device and can be configured to communicate with the computing device of the embodiment of
Although specific embodiments have been illustrated and described herein, those of ordinary skill in the art will appreciate that an arrangement calculated to achieve the same techniques can be substituted for the specific embodiments shown. This disclosure is intended to cover all adaptations or variations of various embodiments of the present disclosure. It is to be understood that the above description has been made in an illustrative fashion, and not a restrictive one. Combination of the above embodiments, and other embodiments not specifically described herein will be apparent to those of skill in the art upon reviewing the above description. The scope of the various embodiments of the present disclosure includes other applications in which the above structures and methods are used. Therefore, the scope of various embodiments of the present disclosure should be determined with reference to the appended claims, along with the full range of equivalents to which such claims are entitled.
In the foregoing Detailed Description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the embodiments of the present disclosure require more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive subject matter lies in less than all features of a single disclosed embodiment. Thus, the following claims are hereby incorporated into the Detailed Description, with each claim standing on its own as a separate embodiment.