CN1107918C - Locking tool data objects in framework environment - Google Patents

Locking tool data objects in framework environment Download PDF

Info

Publication number
CN1107918C
CN1107918C CN98107155A CN98107155A CN1107918C CN 1107918 C CN1107918 C CN 1107918C CN 98107155 A CN98107155 A CN 98107155A CN 98107155 A CN98107155 A CN 98107155A CN 1107918 C CN1107918 C CN 1107918C
Authority
CN
China
Prior art keywords
locking
model
data
lock
shared
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN98107155A
Other languages
Chinese (zh)
Other versions
CN1195144A (en
Inventor
C·L·布雷亚尔艾
D·M·劳聪
J·G·约翰斯顿
陆天耒
V·克利克埃克
D·A·泽勒曼二世
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Publication of CN1195144A publication Critical patent/CN1195144A/en
Application granted granted Critical
Publication of CN1107918C publication Critical patent/CN1107918C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/40Data acquisition and logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

When data, such as tool data, is commonly accessible, there is a danger that con current user processes will make overlapping modifications and leave the data in an incomplet e or incomprehensible state. The invention provides a locking mechanism to guard agai nst this. The lock objects are maintained in pool or repository. Two types of lock objects are prov ided; shareable locks that may be shared by many user processes and permit only read access to the loc ked data, and exclusive locks, useable by only one user process at a time, that permit the own ing process to modify the locked data.

Description

The locking device of tool data object in the framework environment
Relate generally to data processing field of the present invention specifically, relates to the locking mechanism of public visit tool data.
What we submitted to simultaneously is entitled as " the object oriented framework mechanism that common object relation and context management are provided used of multiple tools " application of (IBM Docket No.CA9-97-002) relates to the frame mechanism that tool data management is used.Locking mechanism of the present invention just can be used in such environment.
Instrument is to be the application module in the user stores, manages and the taking-up data are used software unit, program or the program.Each new tool in the exploitation all comprises design, realization and the test job of the storage mechanism that tool data is used.As a result, generally can't neglect with new too development cost related (time and money).
Most of instrument all has their data storing and administrative mechanism, and these are often " proprietary ".In this case, proprietaryly do not share with other tool manufacturer or developer with regard to the details that means its realization.This just causes the relevant many problems of expansion with the existing instrument that customizes for the specific needs that satisfies the user and be confirmed.For example, the storage mechanism or the pattern weave in of the interface of instrument or view part and instrument cause new view and the existing view difficulty on integrated.This is called as instrument and lacks neutral.
In addition, the data of an instrument generation can not be directly or are that another instrument is used pellucidly.On the contrary, need data are write and being called as of the corresponding to external form of other instruments " outlet " and read external formatted data " import " operation, the user of instrument is the export and import of data between the selection tool consciously.
In addition, some may be that the import tool data is stored nonsensical or incompatible with it and throws aside then and there from the data of external form import.This has sacrificed the round integrality of information, and becomes difficult or impossible more than a kind of instrument information is carried out iterative development.
At last, the modification and the invention of tool on other of the necessary monitor management class likelihood data of too development merchant, and increase and new data layout corresponding inlet and outlet function, in the employing of format and other instruments, have the import of handling this form and outlet function can use between hysteresis on the life period.
The program design of object-oriented (OO), especially OO framework technology is for handling and constantly revising existing instrument cost related and provide data integrity that approach is provided in multiple instrument uses.
The Object-oriented Technique of comparing with process technology
Although the present invention relates to be a kind of specific Object-oriented Technique (that is, OO framework technology), but the reader must at first usually understand, and Object-oriented Technique and the traditional technology based on process (often being called process technology) difference are very big.These two kinds of technology are all used the same problem that solves, and are still, always very different to the final solution of problem.This species diversity is from the design focus and complete different these facts of Object-oriented Technique of process technology.Focus based on the technology of process concentrates on the whole process of dealing with problems.On the contrary, how OO design focus concentrates on PROBLEM DECOMPOSITION is become can work together on the entity with one group of autonomy that solution is provided.The autonomous entity of OO technology is called as object.In other words, OO technology obviously is not both with process technology because PROBLEM DECOMPOSITION is become more and organizes the object that cooperates with one another, rather than the hierarchical structure of the computer program of weave in or process.
An evident characteristic of OO technology is that to liking reusable software entity, it can combine with different array configurations, or gives different attributes for different purposes.U.S. Patent No. 5 in U.S.West Technologies company about the method and system of the user interface of the adaptive various data base management system (DBMS)s of generation energy, 550,971 is exactly an example, and it describes a kind of various database structures of illustrating that are used for producing " information form " dynamic model.This model can be transplanted on the different data base management system (DBMS)s, and the user need not to learn different query languages, data base set unify specific data-base recording, field and relation.This model is to represent the concrete class of entity and relation to realize with one group of example with the distance different with actual database.Set up the object of these classes and make it to connect each other, with the tissue of descriptive data base.The class of described model is for developing the real data library structure to set up user interface and to be that the employed database information of cache user interface provides standard interface.
IBM Corporation is about the U.S. Patent No. 5 of the system and method for computer-aided software engineering (CASE), 428,729 along similar route development, it describe one under the environment of the software project of developing for the position of tracking data entity (document, source code and test data) with to its visit, and reference data translation with program (compiler, editing machine, connector, document form device, proving installation (harness)) designed system.Each new project of developing all by " metaprogram person " set up with model, and express with a user graphical interface (GUI).From this " front view ", each user can clone and be made up of the subclass of the main object of selecting according to user's access rights " and User ".By view, specific flow process is described, wherein the user can the visit data entity, edits, defines and handle rapidly and set up process, definition and handle test case rapidly.Access right is by the user's " class " user and object are connected.This patent is towards the apparent and flow process of graphical user interface, and it how to provide to the visit that is stored in the file in the still specific arbitrarily storage vault, store file from the source translation rule to the purpose form, and by the specific view control visit of the user of project.But, this is not OO data integration framework, and this system and fundamental difference of the present invention are, described patent system be not between multiple different and unknown instrument, promote consistent behavior sensation by stipulated but still extendible framework interface and rules design.
In prior art, develop out some to towards the technician of object designs, having the term and the phrase of certain sense.But, " framework " speech defines least strictly; Has different meanings for different people.Therefore, during the characteristic of the frame mechanism of two propositions of comparison, must be careful, to guarantee that this relatively is appropriate.
As also will more specifically describing the back, among the application " framework " speech is be used for describing a kind of OO mechanism that is designed to have Core Feature and extendable functions.Core Feature is that part of not preparing by the frame mechanism of framework buyer modification.On the other hand, extendable functions is clearly for being cut out and expanded that a part of frame mechanism that designs by the framework buyer.
OO frame mechanism
OO frame mechanism can usually be characterized by a kind of OO solution.However, between frame mechanism and basic OO solution, basic difference is arranged.Frame mechanism designs in such a way, i.e. its permission and promotion cut out some aspect of solution and expanded.In other words, frame mechanism not merely is a solution.It is a kind of that mechanism provides " live " solution, it can be cut out and expand, the personalized requirement that changes to satisfy as time passes.Described as superincumbent background parts, the quality of frame mechanism to cut out/expand the buyer be extremely important because to framework cut out and the cost expanded than replacing or to remodify existing non-framework solution much lower.
Therefore, when Frame Design person addressed a specific problem, the work that they did was not only some single objects of design and how they is connected.They also want the Core Feature (that is, do not prepare the part of being cut out and being expanded by the framework buyer in the framework) of design framework and the extendable functions of framework (that is, the part of cutting out possibly and expanding in the framework).Generally speaking, the ultimate value of frame mechanism not only depends on the quality of object designs, but also depends on which aspect that relates to framework represents Core Feature, and which aspect is represented the design alternative of extendable functions.
Taligent, the main points of the U.S. Patent No. 5,325,533 of the Inc company engineering system that modeling is used about computer program are examples of framework.The framework of describing in this patent interacts, produces and set up facility for development environment provides the enhancement type.
The present invention is directed to the mechanism of the data object that is used for locking public instrument visit in the Application development environ-ment.Described mechanism comprises and contains the lock object storage vault.Each lock object all has reference counter, is used to refer to when lock object is taken fully.Lock object can be quoted by data object.
Now will describe embodiments of the invention in conjunction with the accompanying drawings in detail.In the accompanying drawing:
Fig. 1 utilizes the OMT representation to represent the synoptic diagram of the hierarchical structure of the class used according to model object of the present invention;
Fig. 2 to Fig. 6 is the class synoptic diagram according to the frame mechanism of most preferred embodiment of the present invention of expressing with C++;
Fig. 7 is the synoptic diagram that is similar to Fig. 1, and expression is according to the model object of a pair of class of conduct of another most preferred embodiment of the present invention;
Fig. 8 utilizes the OMT representation to represent in accordance with the teachings of the present invention and the synoptic diagram of the hierarchical structure classification of the frame mechanism of constructing;
Fig. 9 is the constitutional diagram of indicated object lock-out state;
Figure 10 is the synoptic diagram that is illustrated in the locking mechanism of realizing in the most preferred embodiment of the present invention;
Figure 11 is the process flow diagram that expression utilizes the step of Core Feature conserving appliance data modification of the present invention;
Figure 12 is that expression utilizes Core Feature of the present invention to send the process flow diagram of the step that the tool data amendment advice uses;
Most preferred embodiment of the present invention has realized in the public data model framework that described framework provides the foundation for shared portion information between different instruments.Described framework is being used for the model mechanism of the information standardization of each instrument generation and being used for information supporting the public storage vault of subregion and code generation to combine.An example of the public storage vault structure that realizes in this most preferred embodiment is we file simultaneously be entitled as " the hierarchical structure metadata used of Integrated Development Environment stores " main points of the application of (IBM Docket No.CA9-97-003), and done sufficient description there.In order to understand most preferred embodiment of the present invention fully, this disclosed remainder also comprises quoting public storage vault in case of necessity.
Just as previously discussed, the principle of framework is model object and these relation between objects that the message block of instrument are made into different classes.
Each model object is all characterized by three information: name, one group of attribute and one group comprise the relation that other model objects in the framework are quoted.The hierarchical structure of model class is shown in Fig. 1.Fig. 2 illustrates the interface of C++ and most preferred embodiment object abstract class for example.
With reference to Fig. 1 and 2, the information relevant with object 1 is such as the name 2 of object and entirely be masked as in several independent strings such as attribute of 3 and define.Each attribute 3 all comprises a value, and the latter is not standard string 3a, is exactly " blob " 3b.(term " blob " be " binarylarge object " abbreviation of (scale-of-two large object), be a term that in database technology, widely uses.Here, it refers to unformed byte serial.The back also will be described in more detail it).
Fig. 4 represents according to the C++ interface of most preferred embodiment to the blob abstract class.Too complicated or too structuring so that be difficult to value with the formal representation of string can be used as the blob class and realizes.Each blob must provide and be provided with and what check it is the operation of the data segment of keyword with the string, and the explanation of described string is responsible for by described blob fully.
According to most preferred embodiment, another aspect of frame mechanism is, the model object shown in Fig. 1 and 2 concern that 4 is by independent class definition, and have unique name mutually.Fig. 3 represents the C++ interface that concerns abstract class of most preferred embodiment, some attribute that will propose below it has defined.
Get back to Fig. 1, each of model object 1 concerns that 4 are all characterized by name 5, and described name is a character string.Each concerns that 4 also comprise one group of 6 (0 or bigger) of quoting to other model objects.Concern that 4 must provide various operations, these operations are to check its name and increase, check or delete its any one in quoting.
Quoting 6 function is, if its model object is not at internal memory, then described object from the disk graftabl.It must be two-way quoting.In other words, if second object of an object reference, then second object must be in its relation, comprises and gets back to quoting first object.In addition, quote be not " by force " be exactly " weak ".When model object 1 was deleted, all model objects of its strongly reference were also all deleted, and when the object of other objects of weak reference is deleted, in other objects, have only deleted object two-way quote deleted.
Two other mechanism of Fig. 1 illustrated also must definition.This is search context 7 and locking context.The locking context has three aspects, and deletion locks 8, locking 9 and modification locking 10 rename.
Model object can suppose that different contexts depends on that described model is to path that described object will pass through.Fig. 5 represents according to most preferred embodiment and C++ interface search context abstract class.The path of search context 7 representative object subclass in the model.The search context provides the operation of seeking and checking attribute, and when requiring to seek an attribute, the search context has found the object with requirement attribute along its model object inventory roaming until it, perhaps finds the end of inventory.If found object, then return the value of described attribute with requirement attribute.Like this, different search contexts just allows the single object in the model to show to such an extent that seem to have different attributes.
Model object in the various relations must be locked by described instrument before they can be changed by instrument.Under the environment of the most preferred embodiment of ccf layer aggregated(particle) structure, also will be described in a more detailed discussion below locking.In order to change the attribute of model object, have only described object itself to need locking.In order to rename to model object, described object itself must be locked with all relations of quoting described object by name.In order to delete model object, described object itself and any one object of the described object of strongly reference directly or indirectly, and quote any one relations of these objects all must be locked.Each object in each relation all is lockable independently, and this basic act is enough for resembling the such shirtsleeve operation of attribute that changes object.Model framework comprises the locking context object, is used for handling renaming and deletion scheme (scenarios) of more complicated.Fig. 6 represents the C++ interface with the deletion locking context 8 and locking context 9 abstract class that rename.
The locking context that renames can be made of model object before renaming to described object.Renaming, context lock is any contains the model object in the relation of described object reference in locking, because some relation may be the key of described object name.
Deletion locking context can be made of model object before the described object of deletion.Deletion locking context will lock any model object (because of under described framework, they are also all with deleted) that described model object and strongly reference chain can touch, and contain any one any relation of quoting in the above-mentioned object.These are quoted and must delete from these relations, quote to prevent to dangle.
In another most preferred embodiment, object class is actually a pair of class, that is abstract class and realization class.This point is in Fig. 7 illustrated.Each model object all comprises 13 the abstract object 11 quoted that contains corresponding realization object 14.
The complete interface of object and behavior are all represented by abstract part.But the name 12 of having only described object is in fact to be stored in the there.The attribute 15 of described object and concern 16 be hidden in realize partly among.Except that name,, all be by realizing that part and some perhaps wherein contained relation satisfy in confidence for any request about object information.
Because abstract, realization and relationship object are lasting independently, will cause from disk 17 request of object name and to pack abstract part into and not comprise the cost that realizes part or relation.This technology is reducing to minimum for satisfying request from the disk data quantity transmitted, thereby improves total performance of each instrument under described framework.
Utilize above-mentioned definition, the framework of most preferred embodiment provides environment and the support scheme that is used for realizing developing the aggregated(particle) structure of inclusive layer flexibly of parts.Foundation class is quoting between part locking (also claiming to contain to support), the object, attribute/property visit, runtime type identification and persistence definition criterion behavior.All instruments are all from the foundation class concrete realization of deriving.
Fig. 8 illustrates the abstract basal layer aggregated(particle) structure according to most preferred embodiment of the present invention for example.In this hierarchical structure, Core Feature is lasting (Persistence) 20, notice (Notification) 21 and locking (Locking) 22, is designated as the foundation class of this hierarchical structure, on dotted line.This is not, any in these classes all can not resemble the C++ programming that works and be capped, but persistence, some form of identification and locking is the desired Core Feature of framework operation of most preferred embodiment of the present invention.The class that dotted line is following from IDE element 24, illustrates some data model type that can be included in this ccf layer aggregated(particle) structure.These extra class definitions are as follows, and the application that some of them are submitted to simultaneously at us (IBM Docket No.CA9-97-003) goes through.
To give a definition according to the data model class of most preferred embodiment in Fig. 8 proposition:
Base (foundation class): the attribute of name, name, the relation of name
IDE Element (IDE element): allow structure/processing graphics tree view/tree element
Containment (containing): file/grouping
Scope (scope): for name space is determined scope
File Reference (file include): a disk file pointer
Sub Part (subassembly): C++ data member for example
Manescope Folder (name scope file): name space the grouping concept of definite scope
Named Part (name parts): the composite type on basis
Model (model): single element root
Builder-Consumable Part (the spendable parts of constructor): assembly--allow by the combination/processing of assemble editing device
Type Def (type definition): parts another name
Enum (enumerating): the set of name radix value
Struct (structure): record
Union (associating): overlapping structure
Primitive Type (primitive type): type of foundation
Builder-Partionable Container (the separable container of constructor): allow the parts of distribution to cut apart
Inheritance in ccf layer aggregated(particle) structure of the present invention works to provide following each point.Persistent services is kept the state of data model in the principal computer file system, and shares these data between several running programs.The model object of deriving from described ccf layer aggregated(particle) structure is that grouping forms the file the file system.Object in the described file system is called as " model submitted to ".When utilizing frame model to come working procedure, have only " submit model to " in data be visible.To described model to change all be to finish on the internal memory copy of model object in the private address space of single running program.
Locked service is forced the mutual exclusion of realization to model modification.Because the routine change of each operation is the copy of model object on special-purpose internal memory, so can not two programs revise or delete same object simultaneously.Locked service provides positive lock mechanism, prevents to visit simultaneously.The back also will go through this point.
Referring to Fig. 9, provide from the inheritance of lasting foundation class 20, model object is by the local heap construction decided at the higher level but not officially announced of each program, and is shared by lasting by the file system of principal computer.In many C++ realize, dynamically or to submit a tender during operation generally all be that form with the pointer of the class special table that points to constant method pointer in each object is implemented.This method list index all is stored in dynamic link routine library or the executable program usually, still, is inaccessible, because each executable image is different, and the position of table also is different.As a result, in general enforcement, can not in shared store, store the C++ object, and from different their data of executable program visit.
Persistent services among the present invention is avoided this problem by local pile structure decided at the higher level but not officially announced.
Persistence (lastingly) class 20 also provides the mechanism of disk read-write for classes all in the framework.The class of deriving of all expansion base class object states all must provide its in the model " read " and " write " method, but class also defines object data stream mechanism lastingly, makes the class covering be used for the stream operator of changing between the disk form of object and the internal memory form.The stream operator calls each object oneself " read " and " write " method, actual processing finished.Following realization agreement is used in all classes, is used for being the class definition of deriving in the most preferred embodiment " read " and " write " method.
In most preferred embodiment, framework is realized mandatory mutual exclusion for the C++ object standard interface is provided.Use the class of this realization to derive from locking class 22.Because the object of sharing between the program that mutual exclusion just moves just requires, so locking class 22 itself is a subclass of lasting class 20.
The locking mode that is provided by Locking (locking) 22 will be discussed below.But it is inappropriate that two kinds of these mechanism of situation are arranged: the first, in the overall situation " parts " in the inventory, a kind of assurance contains the data structure of all objects of particular type; The second, " sludge sump " in, be used for storing with model object but be not a kind of mechanism of the metamessage that has upgraded of a described object part.
Locking class 22 be used for can blocked persistent object model abstract.The locking primitive that uses in it supplies a model.In general, these primitive directly do not use, but call as the part of composite object locking.The object locking is structure in two steps:
1. the locking identifier is to obtain for the type of action of planning to finish.In most preferred embodiment, the locking pond is the C++ single-element class that is positioned at telescopic (scalable) shared drive pond that the back will be described, and handles the name common memory section of fixed size.Therefore, the locking identifier is actually the array index to the pond.
2. utilize the locking identifier that is obtained to share locking or mutual exclusion locking then by the instantiation structure of lock object type.In most preferred embodiment, locking is as the C++ constructor request of local example, no matter make how code block exists removing program all can move automatically by usually.Obtaining the failure of locking is passed on by exception.Removing program discharges locking under most of situation, an exception is to upgrade the locking context.
Single-element class is meant that each class of each process once can only have the C++ programming agreement of an example alive.
Telescopic shared drive pond is the point-to-point caching mechanism, relates to the application heap that distributes fixed size from the name shared drive pond of system.The name of application heap is by getting predetermined character sequence, and the back encloses that segment number (since 0) sets up then.Each process all has the single element pond, and it is the section that described process is handled cache pool.When will the section of looking for novelty, calculate its name, and attempt in current internal memory, to find out described section.If can not find, then distribute described section.This process is synchronous like this, and the application heap that makes first process require will distribute it, and each process subsequently all will visit again its (thereby, be point-to-point, rather than client/server).Each single element cache pool class in the process all keeps the array of the section known to all it.This just can be used as quick dereference to array and visits any one section in the described process.Except the section array, also distribute special name zone, wherein contain global information relevant for described pond.The name in this zone is fixed, and first process that starts described cache pool will be distributed it.Visit to global information in the pond is synchronous, to avoid race condition occurring between two or more processes.
Each section all handled as the array of objects of fixed size, makes each section all be divided into size to be " x " " n " piece (wherein " x " be the object size of preparing to be placed in the pond).Each process is just asked a section identifier (id) when it needs a slice storage area.Described pond uses the global information section to find the current the highest call number that has provided.If next value is in a section (that is, be not the multiple of n) still, then just it is returned.Otherwise, check current all objects in described pond, with the object that finds not using.In the section of pond " n " in the individual storage area each all has an indicator, indicates that it is to have used or do not used, and makes single-element class can finish this inspection.If find untapped object, then its call number is returned, and described canned paragraphs is marked as uses, otherwise distribute new section.
In case send a call number, it just can be used for by the shared memory storage section of special cache pool way access.This pond method is just got described call number, and calculates the call number in segment number and described section.Then, its access segment address array, the address of calculating object in described section then.Like this, same identifier (id) can be used by a plurality of processes, even shared drive can be assigned to different virtual addresses, resembles such as Windows TMThe same on some platform such as NT.Be calculated as follows:
Segment number=pond identifier/n
Segment index number=pond identifier mould n
Described pond is telescopic, because it can distribute each section as required.Why it is a point-to-point, is which kind of begins (not needing server) in proper order with all to have no relations because relate to how many processes or they.Described mechanism only requires that two dereferences come to visit any one by its identifier.
In most preferred embodiment of the present invention, the type of lock object is:
1. share locking: share read-only access; And
2. mutual exclusion locking: the read of a process of restriction.
Institute is illustrational as the constitutional diagram of Fig. 9, constructs a lock object and has just locked visit to the lockable model object below it.In most of the cases, the releasing of lock object is that the release visit is desired.Like this, by will delete the lockType instantiation, removing the instantiation of sharing lockType, the restricted read of sharing of the model object below it just is resumed.This has guaranteed that described object will be not deleted, and allows other (objects) to read or revise its (that is obtaining modification locking that share or mutual exclusion).Lock object below it is exception when being modified.When modification was saved, locking can be disengaged.
Positive lock to structure or releasing puts teeth in by agreement.The constructor of frame clsss and releasing program are " protection ".This has prevented that program from directly setting up or the deletion object.On the contrary, class data " foundation " and " releasing " method provides for each frame clsss.Method for building up obtained to set up or inserts the necessary locking of object in existing model before the structure object.Release method obtained to delete necessary all lockings of each object all references from described model before the deletion object.The result who obtains the locking failure is that retouching operation is abandoned, and model state is constant, and exception is dished out.
The lifetime of locking had not only been depended on lasting subsystem but also had depended on the existence of the lock object of quoting the locking in the internal memory.Figure 10 for example understands this point.Lock object class 100 has locking of sharing 102 and mutual exclusion locking 104 as derivant.The two difference is to share locking can have many processes, and the mutual exclusion locking is once " mutual exclusion " be a process.Single process resource can have a mutual exclusion locking thereon or have one or more shared lockings.
When lock object 100 during by 106 instantiations of lockable object, the locking identifier (id) that is endowed by by means of the lockable object of structure the time is quoted locking pond 108 with lock in place.Locking 112 in the locking pond contains the process identifier (id) that locks owner 116.If the locking owner attempt to obtain again one it had locking the time, this allows.
Under the situation of sharing locking, process identifier (ID) identifier always empty or that keep.The identifier of same sky is obtained shared locking trial by all and uses.Like this, had by any one process institute certificate if share locking, then process identifier will be mated, and go through and lock.In order to follow the tracks of the number of sharing the locking owner, use reference counter.Obtain the described counter of locking at every turn and just add one, and each release locking just subtracts one.When counter reached zero, described locking was just no longer had by any process, and can be used as shared locking or mutual exclusion locking.
Under the situation of mutual exclusion locking, use real process identifier in case share.A kind of special type of mutual exclusion locking is " modification " locking, it follows the tracks of the state of modification of locked object.If object is not modified, then described being locked in when its removing program moves is released immediately.If blocked object has been modified, then revise locking and will can not be modified the latch-release program and discharge, until all changes to blocked object all be saved submit to or cancel till.Be not disengaged (finishing even preserve) if revise locking, then described object is still locked.Program can make object keep locking in the preservation process according to this behavior.
Pointed out to be used for two exceptions of locking mechanism above, overall component list and " sludge sump ".
Overall situation component list contains the object of one group of unique name.In the framework of most preferred embodiment, this is comprised in the single object, that is single-element class.When having realized containing the shared drive inventory of the data structure that detects name conflict, parts are added into the overall inventory of program, and submit inventory to or do not submitting to the parts name to share the name that detects described parts in the inventory whether have uniqueness at parts.If described name is not unique, then add operation failure, and exception is dished out.Otherwise, finish and insert operation, and described name is added shared heap, use it to prevent another program.Each program of moving is all kept the inventory of the object that it inserts.When preserving the operation well afoot, all these objects of described program reset.By only storing name, scalability is provided, the quantity that wherein prevents the shared drive that name conflict is used in the overall parts group is reduced to minimum.
Second exception is sludge sump.This refers to a kind of call number pond, and it follows the tracks of whether object is modified and their correspondingly renewal of source code file.An object must regenerate when its dependence changes.Do not revise actual object between can the minimizing process lock contention and improve performance.When described object and its source file lack concurrency, just say described object " contaminated " or " dirty ", gain the name therefrom in described index pond.Sludge sump uses scalable shared drive pond mechanism to support the teledata that shared object is used.Teledata is the encapsulated object state that does not depend on described object.This data can not revised the lock contention between the minimizing process by the order of lock object, modification object, conservation object.Locking pond indexing model is used in described pond, and an object is endowed identifier, the position section in the sludge sump index, and the latter is constant during the lifetime of model object.Each sludge sump section all in two, the first half have and use the position, and the second half have stained mode bit.In pond described in the most preferred embodiment is lasting.Sludge sump can deposit itself in disk in the mode of stream or from wherein taking out.With such method, the information whether source of object needs to regenerate just can be inquired about in dialogue subsequently.
When model is submitted in variation, persistent services there are three requirements:
1. when operating according to the model of submitting to, program can not read the redaction of old object;
2. finish variation is write the model collapse that the file failure can not make submission; And
3. the change of being done in the program can not cover the change that another program is submitted to.
The form that preservation was submitted to two stages in, the file system synchronous by the Inter-Process Communication rules realizes.The process flow diagram of Figure 11 is for example understood this process.
The Inter-Process Communication rules are utilized two incidents; " preserve underway " and " preservation finishes ".These incidents are by means of shared drive sign, shared drive counter and two what is called " notice " and " affirmation " and the main system semaphore realize.
When the program of preserving is sent " preserve and to carry out " incident the time (square frame 40), begin to preserve." sending incident " is exactly that incident shared drive sign is set to very, with model shared drive counting be initialized as subsidiary described model program number, " affirmation " semaphore resets, and charges to " notice " semaphore.
When described logo file showed that the stage 1 of preservation has begun (square frame 42), the All Files that the program of preserving was revised it all deposited temporary file (square frame 44) in.Deposit temporary file in and can prevent other routine access temporary files, if they still effectively utilize described model.This has satisfied half of part 1 of safe storage target, and promptly other programs can not be mixing with object in the temporary file from the object of the model of submitting to.
In case the program of preserving all writes temporary file (square frame 46) to the file that was changed, it is just waited for " preserve and carry out " incident finish.When charging to " affirmation " semaphore the time (square frame 38), this just is recognized to the program of sending.
Preserving the incident of carrying out is handled by the worker thread that finds in each program that is attached on the frame model.When receiving described incident, worker thread is waken up.Described thread by all models opened in the program with have be provided with preserve sign model relatively, determine whether their program is attached on the model that is being saved.If described program is to be attached on the model of preserving, use intersection thread bag notice to be charged to the main thread of program.Main thread handle all graphical user interface (GUI) incident and the notice (square frame 58) that before the unsettled notice of having preserved, receives afterwards, receive this notice asynchronously.
When the main thread of described program received same unsettled notice, it stopped requirement and packs into or change object (square frame 60) in the described model.This has finished and has required 1, and promptly program can not be mixed old and new object.
When other programs received and handle the ongoing incident of preservation, they confirmed to receive described incident by the shared drive counter being subtracted one (square frame 62).When the counter that subtracts equaled 1, all programs were all treated " notice ", and incident " affirmation " semaphore is credited to, and indicates described incident and finishes (square frame 64), wakes the program (square frame 48) of sending (notice) up with this.
When " preserve and to carry out " when incident was finished, the program of preserving represented that with indicating the phase one of preserving finishes (square frame 46) by the logo file on the disk.At this moment before carving, such as the interruption of system crash institute is changed and lose, but the state that database still is consistent.
If inerrancy takes place, all required data of revision of visiting described model have all write disk, and can not make the model on the disk be in inconsistent state owing to system or program crashing.The program of preserving then is renamed as their suitable names to temporary file, and the model free data file (square frame 50) that deletion is from submitting to.This means its content of file that was changed all with the replacement of the version in the temporary file, and this has satisfied the part 2 that safe storage requires.
The program of preserving is sent to worker thread of waiting for and program main thread " preserve and finish " incident (square frame 60), so that the model that indicates on the disk to all these programs is consistent, and wait for finish (square frame 54) of described incident before removing (square frame 56).
Another Core Feature sees the notice foundation class 21 of Fig. 9, for the change of the tool data in other user notification frameworks provides mechanism.This is also in Figure 11 illustrated.
All are attached to all other programs on the described model when they receive " preserve and finish " all be waken up during incident (square frame 64).Then, the method for refreshing of these routine call frameworks, the latter visits each file that described program is opened, and the latest edition of each object that changed of packing into (square frame 66).In case this process is finished, what each program all comprised described model time changes consistent special-purpose internal memory version with up-to-date preservation.If the object that described program contains the deletion of any one program of having been preserved or changed then receives " preservation finishes " program of incident also allows model/view/controller give notice to each observer of affected object (square frame 68).What observing this notice is the internal state and the consistent hook of submitting to described model (program) of change that program is used for making them.Finish refresh after, each program all confirms to receive the incident (square frame 70) of finishing of preserving.
Finishing the work of preserving the incident of finishing wakes the program of preserving and all worker threads up.The program of preserving is finished any internal affairs and is returned from preserve.Each worker thread turns back to them in the waiting status of preserving incident between unsettled process.
Whether the operation that changes many model objects can successfully be finished, and this always can be not predetermined, so in another most preferred embodiment of the present invention, persistent services is provided at the ability that turns back to known kilter in the incident of failure.In Figure 12 illustrated this process.
The special-purpose internal storage state of this checkpointing mechanism recovery routine.The state of prepare preserving comprises from program start or deletion, foundation and the modification of having preserved all objects that taken place since the model, and the data structure of the persistent services used of management object and data file.In the operating process of checkpointing mechanism, these data are kept in the temporary file.
The routine call checkpointing mechanism indicates it and has begun to return to possibly the modification (square frame 76) of state in the past.This then lasting subsystem is visited each lasting file of being opened by the program on the described model.Persistent system identifies the object (square frame 78) that makes internal storage state be different from submit state for it.In internal memory, the model that is modified is flagged as and is kept at (square frame 80,82) in the temporary file.
When the modification of attempting to finish is unsuccessful, generally be because exception is dished out and is captured on (square frame 84,86), call " rerun " method (square frame 88).Rerun method and rebulid object deleted after described checkpoint, delete the object of setting up after the described checkpoint, and the state (square frame 90) the when recovering state of the state of all objects that are modified and persistent services data structure is called in the checkpoint to them.
If this process determines that described algorithm successfully finished (square frame 84,86), it just calls " submissions " (square frame 92), discharging the employed resource of checkpointing mechanism, and be the internal model Status Flag unanimity.
It is apparent that concerning the professional and technical personnel: the modification to the above-mentioned most preferred embodiment of the present invention all is included within the scope of appended claim book.

Claims (7)

1. locking device that is used for locking the data object of public instrument visit in Application development environ-ment is characterized in that comprising:
Memory storage, it is used for storage repositories, described storage vault comprises lock object, each lock object all has indicator, be used for specifying it be dedicated process take or state freely; And
Quote the device of lock object from described data object.
2. according to the locking device of claim 1, it is characterized in that described lock object comprises:
Can share locking, it is suitable for by a plurality of dedicated process shared; And
The mutual exclusion locking, it is suitable for by once shared by a dedicated process.
3. according to the locking device of claim 2, it is characterized in that: but the indicator that the shared lock definiteness is decided to be occupied state is comprised the reservation process identifier, and described reservation process identifier is suitable for being produced again by one or more dedicated process described sharing in the locking.
4. according to the locking device of claim 2, it is characterized in that: the indicator that the mutual exclusion lock definiteness is decided to be occupied state comprises the process identifier of dedicated process.
5. according to the locking device of claim 2, it is characterized in that also comprising being used for unlocking the device of object that described decontrol comprises under the situation of mutual exclusion locking:
Be used for determining the device that whether was modified from the data object that the mutual exclusion locking is quoted; And
Be used for the device that before any modification to described data object all is saved delay lock removes.
6. according to the locking device of claim 2, it is characterized in that: the mutual exclusion locking is suitable for existing lastingly in the preservation process, unless be disengaged clearly.
7. according to the locking device of claim 2, it is characterized in that: be in free state lock object can with or the form of locking or mutual exclusion locking can shared shared by dedicated process.
CN98107155A 1997-03-27 1998-03-05 Locking tool data objects in framework environment Expired - Fee Related CN1107918C (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CA002201275A CA2201275A1 (en) 1997-03-27 1997-03-27 Locking tool data objects in a framework environment
CA2201275 1997-03-27

Publications (2)

Publication Number Publication Date
CN1195144A CN1195144A (en) 1998-10-07
CN1107918C true CN1107918C (en) 2003-05-07

Family

ID=4160286

Family Applications (1)

Application Number Title Priority Date Filing Date
CN98107155A Expired - Fee Related CN1107918C (en) 1997-03-27 1998-03-05 Locking tool data objects in framework environment

Country Status (4)

Country Link
KR (1) KR100313844B1 (en)
CN (1) CN1107918C (en)
CA (1) CA2201275A1 (en)
TW (1) TW346604B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100426620B1 (en) * 2000-12-26 2004-04-13 한국전자통신연구원 Method of an class instance updating with OID in the main memory resident, object-relational DBMS
US7409389B2 (en) * 2003-04-29 2008-08-05 International Business Machines Corporation Managing access to objects of a computing environment
US20050081204A1 (en) * 2003-09-25 2005-04-14 International Business Machines Corporation Method and system for dynamically bounded spinning threads on a contested mutex
US7614054B2 (en) * 2003-12-31 2009-11-03 Intel Corporation Behavioral model based multi-threaded architecture
US9026993B2 (en) 2008-06-27 2015-05-05 Microsoft Technology Licensing, Llc Immutable types in imperitive language
CN101350022B (en) * 2008-08-27 2010-04-14 中国工商银行股份有限公司 Changing process method based on database logical lock
US8495329B2 (en) 2009-04-13 2013-07-23 Microsoft Corporation Type system support for memory isolation permissions
US9569282B2 (en) 2009-04-24 2017-02-14 Microsoft Technology Licensing, Llc Concurrent mutation of isolated object graphs
CN101957779B (en) * 2010-09-16 2013-04-03 深圳天源迪科信息技术股份有限公司 Management method of timer
CN102279804A (en) * 2011-08-16 2011-12-14 天津市天祥世联网络科技有限公司 Memory pool structure of video monitoring platform system and method for implementing memory pool structure
CN103207809B (en) * 2012-01-13 2017-07-07 金蝶软件(中国)有限公司 Remove the method and system of mutual exclusion lock
CN102693159B (en) * 2012-05-09 2015-07-01 上海晨思电子科技有限公司 Method and device for controlling hardware equipment based on user mode multitask
CN102708323B (en) * 2012-05-15 2015-08-12 中科方德软件有限公司 The method of file object reuse is prevented in secure operating system
US9619769B2 (en) * 2014-04-01 2017-04-11 Sap Se Operational leading indicator (OLI) management using in-memory database
CN106326014A (en) * 2016-08-24 2017-01-11 杭州费尔斯通科技有限公司 Resource access method and device
CN109947704B (en) * 2017-11-20 2021-06-04 华为技术有限公司 Lock type switching method and device and cluster file system
CN111563066B (en) * 2020-04-24 2023-08-11 深圳震有科技股份有限公司 Method and device for realizing application program single-instance processing based on file lock

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5325533A (en) * 1993-06-28 1994-06-28 Taligent, Inc. Engineering system for modeling computer programs
US5428729A (en) * 1991-12-20 1995-06-27 International Business Machines Corporation System and method for computer aided software engineering

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428729A (en) * 1991-12-20 1995-06-27 International Business Machines Corporation System and method for computer aided software engineering
US5325533A (en) * 1993-06-28 1994-06-28 Taligent, Inc. Engineering system for modeling computer programs

Also Published As

Publication number Publication date
CN1195144A (en) 1998-10-07
CA2201275A1 (en) 1998-09-27
KR19980079611A (en) 1998-11-25
TW346604B (en) 1998-12-01
KR100313844B1 (en) 2001-12-12

Similar Documents

Publication Publication Date Title
CN1107918C (en) Locking tool data objects in framework environment
US6026401A (en) Locking tool data objects in a framework environment
Flemming Case-based design in the SEED system
US5812130A (en) Data management system and method for concurrent engineering
Estublier et al. Impact of software engineering research on the practice of software configuration management
JP2986051B2 (en) Object oriented computer system and object execution method
US5864875A (en) Data management system for problems, releases and parts
US5671398A (en) Method for collapsing a version tree which depicts a history of system data and processes for an enterprise
US6073111A (en) Container materialization/dematerialization for reduced dataload and improved data-coherency in workflow-management systems
US5488722A (en) System and method for automating implementation and execution of constraint most likely to be violated in a database
CN101416153B (en) Systems and methods for the implementation of a digital images schema for organizing units of information manageable by a hardware/software interface system
CN1816791A (en) System and a method for presenting items to a user with a contextual presentation
CN1864129A (en) System and a method for presenting related items to a user
EP0841612A2 (en) Framework for software development
Demuth et al. Efficient detection of inconsistencies in a multi-developer engineering environment
CN1729448A (en) Transparent EJB support and horizontal data partitioning
CN1871598B (en) Systems and methods for extensions and inheritance for units of information manageable by a hardware/software interface system
Damchoom et al. Applying event and machine decomposition to a flash-based filestore in Event-B
Sriplakich et al. Collaborative software engineering on large-scale models: requirements and experience in modelbus
CN1125991A (en) A method of attaining data access in a primary memory based database
Rehm et al. Support for design processes in a structurally object-oriented database system
Lindsay et al. A generic model for fine grained configuration management including version control and traceability
Render et al. An object-oriented model of software configuration management
CN1154518A (en) System, method and article of manufacture for adding object services to binary class in object oriented system
Ali et al. Action-driven consistency for modular multi-language systems with perspectives

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1038605

Country of ref document: HK

C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20030507