Compiler device and computer-readable recording medium with...

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000

Reexamination Certificate

active

06735763

ABSTRACT:

FIELD OF THE INVENTION
The present invention relates to a compiler device which can easily prevent generation of an access conflict occurring when object data is accessed from a plurality of threads by automatically serializing the access of the plurality of clients. The present invention also relates to a computer-readable recording medium with a compiler for the compiler device recorded therein.
BACKGROUND OF THE INVENTION
Conventionally, there has been used a client-server system in which a plurality of clients share an application program on a server for effective use of the resources. In such a client-server system, a thread for launching an application program is generated in response to initiation by a client. When a plurality of threads are generated for one object data in response to initiation by a plurality of clients then there occurs a conflict between the threads. A means and a method for effectively avoiding such an access conflict was required.
FIG. 23
is a block diagram showing configuration of a client-server system based on the conventional technology as described above. The client-server system shown in this figure comprises a server
1
, a client
4
1
and a client
4
2
each connected to the server
1
via a network
3
. In the server
1
, an application program AP
1
and an application program AP
2
are programs each in an execution format with a source program compiled by means of the object-oriented programming, and are started by the client
4
1
and client
4
2
.
The application program AP
1
corresponds to a super class C
1
in the object-oriented programming. On the other hand, the application program AP
2
corresponds to a subclass C
2
inheriting the super class C
1
. With the inheritance relationship between the two classes, a common area C
0
(object data) of the super class C
1
is accessed when the application program AP
1
and application program AP
2
are started. A thread generator
2
generates a thread S
1
and a thread S
2
to execute the application program AP
1
and application program AP
2
.
In the above-described configuration, when the application program AP
1
and application program AP
2
in the server
1
are started by the client
4
1
and client
4
2
, the thread generator
2
generates the thread S
1
and thread S
2
respectively. When the application program AP
1
and application program AP
2
are executed, there occurs an access conflict in which the thread S
1
and thread S
2
concurrently access the common area C
0
(object data). In order to prevent the access conflict it is required to provide exclusive controls for serializing the thread S
1
and thread S
2
so that the thread S
1
and thread S
2
do not concurrently access the common area C
0
(object data). The exclusive controls are the controls for avoiding an access conflict by giving access rights to the common area C
0
to the thread S
1
(or the thread S
2
) and giving the access rights to the thread S
1
(or the thread S
1
) when the access from thread S
1
terminates.
As an example of the exclusive controls based on the conventional technology, there has been employed a method in which a user of an application program makes a thread acquire a lock to execute the application program. The lock is acquire through a manual input of a command or the like by the user before the application program is executed (this method is described as a first method hereinafter). The application program is executed only by the thread having acquired the lock, and other threads can not execute the application program. When execution of the application program is finished, the lock is released by the user. The application program can then be executed by any other thread. Further, as another example of exclusive controls in the conventional technology, there has been employed a method in which a programmer describes instructions to execute the above-described exclusive controls in the definition of a method when creating the super class C
1
and the subclass C
2
(This method is described as a second method hereinafter).
As described above, conventionally the exclusive controls are provided by applying the first or second method to avoid an access conflict in which a plurality of threads concurrently access the common area C
0
(object data).
In the first method, however, as acquisition/release of a lock is performed manually by a user, the user may sometimes make a mistake such as forget to release the lock, which may in turn cause the trouble that other thread (user) can not access the application program for a long time. Therefore, the first method may lead to lower efficiency in use of an application program, and employment of this method is not always advantageous. Further, in the first method, it is difficult for a user to intentionally provide exclusive controls for a data structure of the application program, especially for a class in which object data exists. To overcome this difficulty, in the first method, the exclusive controls are provided for each application program regardless of presence or absence of object data in the class. However, there may occur a case in which exclusive controls are executed to an application that does not basically require any exclusive controls. In such a case, the use efficiency of the application program is disadvantageously lowered.
In the second method, although instructions are described by a programmer for describing the method to provide the above-described exclusive controls, there is a possibility that incorrect commands for exclusive controls are described due to a human error. In this case, there occurs the trouble that exclusive controls are not executed successfully. Thus, the second method is also not recommendable. As described, the first and second methods require users (including programmers) a heavy work load, yet the methods do not always insure success in prevention of an access conflict.
SUMMARY OF THE INVENTION
It is an object of the present invention to provide a compiler device which can easily avoid an access conflict over object data among a plurality of threads without requiring any particular work load to users. It is another object of the present invention to provide a computer-readable recording medium with a compiler recorded therein.
According to one aspect of this invention, when a source program is compiled, a detection unit detects the presence or absence of an object data for a method based on the class definition in the source program. A first incorporation unit incorporates the result of detection into the object program as object-data-retention information. Further, a second incorporation unit incorporates an exclusive-control instruction into the object program. Therefore, when the object program is executed, one of a plurality of threads can only execute the method corresponding to the object data under the exclusive controls.
As described above, the object-data-retention information and exclusive-control instruction are automatically incorporated into the object program during compilation. Therefore, generation of access conflict over object data between a plurality of threads can easily be avoided without imposing any particular burden on the user.
Further, when the source program is compiled, an inheritance-relation check unit checks an inheritance relationship for a class in the source program, a detection unit detects presence or absence of object data for a method of a class inherited by the class. The first incorporation unit then incorporates a result of detection into the object program as the object-data-retention information, and the second incorporation unit incorporates the exclusive-control instruction into the object program. Therefore, when the object program is executed, only one of a plurality of threads can execute the method corresponding to a class inherited by the class under the exclusive controls.
As described above, the inheritance relationship for a class is checked during compilation of the program, and the object-data-retention information and the exclusive-control instr

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Compiler device and computer-readable recording medium with... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Compiler device and computer-readable recording medium with..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Compiler device and computer-readable recording medium with... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3244245

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.