The subject matter disclosed herein relates to a system and method of providing a version control system (“VCS”) repository, and particularly to a system and method of saving files to a VCS repository.
One challenge faced in large scale software development is the issue of concurrency with multiple threads. For various types of processing applications, a system may handle multiple events or processes concurrently. Specifically, a process may have multiple threads. A thread is a basic unit of program execution. At any given time, a program may have multiple threads running concurrently, where each thread performs a different job.
Concurrency issues may occur when multiple processes or threads are used. For example, one issue that may occur is deadlocking. One example of a deadlock is when a thread, which is referred to as t1, owns resource A and wants to acquire resource B, which is owned by thread t2. For thread t1 to access resource B, thread t1 has to wait until thread t2 releases resource B. However, in the event thread t2 is waiting for thread t1 to release resource A before releasing resource B, t2 remains in a wait state. This creates a situation where threads t1 and t2 are unable to proceed. Also, sometimes a particular thread may wait on the resources that the same thread already currently owns, which leads to an infinite wait condition.
In one approach, concurrency issues may be reduced by locking files such that only one software developer at a time may have write access to a centrally located file located in a repository. Thus, once a software developer checks out a specific file, other developers may read the specific file, but no other software developer may modify the specific file until the specific file is checked back into the repository. However, this approach may not be efficient, as only one software developer at a time is able to modify a specific file.
According to one aspect of the invention, a method of saving files to a version control system (“VCS”) repository located on a VCS server is provided. The VCS repository has at least two files. The method includes executing at least two processes by at least one server. The method includes creating a workspace for each of the at least two processes. The workspace corresponds to one of the at least two processes. The method includes saving a temporary version of at least one target file selected from the VCS repository to the workspace. Each of the at least two processes has the temporary version of the at least one target file saved to the workspace. The method includes committing the temporary version of the at least one target file back to the VCS repository.
These and other advantages and features will become more apparent from the following description taken in conjunction with the drawings.
The subject matter, which is regarded as the invention, is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other features, and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
The detailed description explains embodiments of the invention, together with advantages and features, by way of example with reference to the drawings.
As used herein the terms module and sub-module refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or group) and memory that executes one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
Referring now to
The VCS 10 is configured for executing at least two processes. In the exemplary embodiment as shown in
It should be noted that while
Continuing to refer to
As processes 1 and 2 execute, process 1 and process 2 may require at least one of the plurality of files that are stored on the VCS repository 30. Thus, process 1 and process 2 may be communicated over the network 24 to the VCS server 20. The VCS server 20 includes control logic for determining the appropriate file in the VCS repository 30, depending on the resources required by the specific process. Specifically, the VCS server 20 includes control logic for determining a target file or files required by process 1, and the VCS server 20 also includes control logic for determining the a target file or files that are required by process 2. In one embodiment, the target file or files from the VCS repository 30 may be the same for process 1 and process 2, however it is to be understood that process 1 may require different target files from process 2 as well. In one illustrative embodiment where Java ® is used, process 1 and process 2 both pass through a File Directive object. The File Directive object specifies the particular file in the VCS repository 30 that is required by either process 1 or process 2.
Once the VCS server 20 selects the target file or files from the VCS repository 30, a workspace is created. Specifically, referring now to
Once an end-user is finished making revisions to the temporary version of the target file saved in the workspace, the temporary version of the target file may be committed back to the VCS repository 30. The commit operation, which is also referred to as a check-in operation, involves saving the revisions made to the temporary version of the target file back to the VCS repository 30 as a revision file. The commit operation will make any changes made to the temporary version of the target file final and available to all end-users. Specifically, server 1 and server 2 may each send a commit signal over the network 24, which causes the VCS server 20 to pick up the temporary version of the target file from workspace 1 and workspace 2. Once the temporary version of the target file from is committed to the VCS repository 30 as the revision file, the VCS server 20 includes control logic for sending a signal back to the respective process being executed on the server 22 indicating the revision number and the location of where the revision file is saved in the VCS repository 30. For example, once an end-user is finished making revisions to the temporary version of the target file saved in workspace 1, the temporary version of the file is committed back to the VCS repository 30 with a specific revision number. In one illustrative embodiment, the temporary version of the file is saved in the VCS repository 30 as a revision file named “Revision 1.0”. A signal is sent over the network 24 back to process 1 located on server 1 that indicates the revision number (i.e., in the example as described the revision number would be 1.0) and the location of the revision file.
Once the temporary version of the target file has been committed back to the VCS repository 30, the temporary file may be deleted from the respective workspace. For example, if Java® is employed, a dispose method may be used to dispose of the respective workspace. In one illustrative embodiment, once the revision file “Revision 1.1” is saved to the VCS repository 30, then a dispose method is employed to dispose of workspace 1.
A method of using the VCS 10 for saving files to the VCS repository 30 will now be discussed.
In 104, a workspace is created for each process. Thus, each process is allocated one of the workspaces. For example, referring to
In 106, a temporary version of a target file or files from the VCS repository 30 is saved on each workspace. Method 100 may then proceed to 108.
In 108, the temporary version of the target file is committed back to the VCS repository 30 as a revision file. For example, referring to
In 110, a signal is sent over the network 24 back to the process indicating the revision number of the revision file and the location of the revision file. For example, referring to
In 112, the temporary version of the target file is deleted from the respective workspace. For example, if Java® is employed, a dispose method may be used to dispose of the respective workspace. Method 100 may then terminate.
The VCS 10 as shown in
While the invention has been described in detail in connection with only a limited number of embodiments, it should be readily understood that the invention is not limited to such disclosed embodiments. Rather, the invention can be modified to incorporate any number of variations, alterations, substitutions or equivalent arrangements not heretofore described, but which are commensurate with the spirit and scope of the invention. Additionally, while various embodiments of the invention have been described, it is to be understood that aspects of the invention may include only some of the described embodiments. Accordingly, the invention is not to be seen as limited by the foregoing description, but is only limited by the scope of the appended claims.