KR20010053691A - Method for entering critical section for synchronizing distributed database applications - Google Patents
Method for entering critical section for synchronizing distributed database applications Download PDFInfo
- Publication number
- KR20010053691A KR20010053691A KR1019990054158A KR19990054158A KR20010053691A KR 20010053691 A KR20010053691 A KR 20010053691A KR 1019990054158 A KR1019990054158 A KR 1019990054158A KR 19990054158 A KR19990054158 A KR 19990054158A KR 20010053691 A KR20010053691 A KR 20010053691A
- Authority
- KR
- South Korea
- Prior art keywords
- mutual exclusion
- transaction
- mutex
- data
- shared
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/526—Mutual exclusion algorithms
Abstract
Description
본 발명은 분산 데이터베이스 프로그램 간의 동기화 방법에 관한 것이며, 특히, 동시 다중 사용자 환경에서 공유 자원에 대한 배타적 수행을 제어함으로써, 공유 자원의 무결성을 유지할 수 있는 분산 데이터베이스 프로그램 간의 동기화를 위한 임계 영역 진입 방법에 관한 것이다.The present invention relates to a synchronization method between distributed database programs. In particular, the present invention relates to a critical area entry method for synchronization between distributed database programs capable of maintaining the integrity of shared resources by controlling exclusive performance of shared resources in a concurrent multi-user environment. It is about.
종래의 분산 데이터베이스 프로그램 간의 동기화 방법은 하나의 컴퓨터에서 여러 프로세스(Process) 간의 상호 배타적 운영과 하나의 프로세스 내에서 여러 쓰레드(Thread) 간의 상호 배타적 운영에 관한 것이다. 프로세스 간의 상호 배타적 운용을 위해서는 하드웨어 수준에서 기계어를 지원하고, 운영 체제(Operating System)에서 세마포어(Semaphore) 및 상호 배제(Mutex) 등을 지원하고 있다.Conventional methods for synchronizing between distributed database programs relate to mutually exclusive operations between multiple processes on one computer and to mutually exclusive operations between several threads within one process. For mutually exclusive operation between processes, machine language is supported at the hardware level, and Semaphore and Mutex are supported at the operating system.
공유 자원에 대해서 세마포어를 할당하고, 공유 자원에 접근하는 프로세스는 잘 정의된 순서로 상기 세마포어를 사용하게 함으로써, 공유 자원의 무결정을 유지한다.The process of assigning semaphores to shared resources and accessing the shared resources allows the semaphores to be used in a well-defined order, thereby maintaining indetermination of the shared resources.
쓰레드의 상호 배타적 운영도 위에서 설명한 프로세스의 경우와 유사하다. 다만, 쓰레드들은 하나의 프로세스 주소 공간에 있기 때문에 별도의 운영 체제 지원이 필요하지 않다. 즉, 쓰레드 간의 상호 배제 인터페이스(Interface)는 쓰레드 라이브러리 또는 프로그래밍 언어 수준에서 지원하기 때문에 종래의 기술에 따르면, 분산된 프로세스간의 상호배제를 구현하기 어렵다는 문제점이 있다.The mutually exclusive operation of threads is similar to the process described above. However, since the threads are in one process address space, no additional operating system support is required. In other words, since the mutual exclusion interface between threads is supported at the thread library or programming language level, according to the related art, it is difficult to implement mutual exclusion between distributed processes.
본 발명은 상기와 같은 종래 기술의 문제점을 해결하기 위하여 안출된 것으로서, 동시 다중 사용자 환경에서 공유 자원에 대한 배타적 수행을 제어함으로써, 공유 자원의 무결성을 유지할 수 있는 분산 데이터베이스 프로그램 간의 동기화를 위한 임계 영역 진입 방법을 제공하는데 그 목적이 있다.SUMMARY OF THE INVENTION The present invention has been made to solve the above problems of the prior art, and by controlling exclusive execution of shared resources in a simultaneous multi-user environment, a critical area for synchronization between distributed database programs that can maintain the integrity of shared resources The purpose is to provide an entry method.
도 1은 본 발명에 적용되는 분산 데이터베이스 프로그램 환경의 개념도이고,1 is a conceptual diagram of a distributed database program environment according to the present invention,
도 2는 본 발명의 일 실시예에 따른 공유 자료에 상호 배제를 표현하는 방법을 개략적으로 나타낸 개념도이고,2 is a conceptual diagram schematically illustrating a method of expressing mutual exclusion in shared material according to an embodiment of the present invention,
도 3은 본 발명의 일 실시예에 따른 분산 데이터베이스 프로그램 간의 동기화를 위한 임계 영역 진입 방법을 나타낸 흐름도이다.3 is a flowchart illustrating a method for entering a critical region for synchronization between distributed database programs according to an embodiment of the present invention.
앞서 설명한 바와 같은 목적을 달성하기 위한 본 발명에 따르면, 공유 자료에 상호 배제(Mutex)를 위한 상호 배제 자료를 생성하는 제 1 단계; 여러개의 프로세스(Process)가 임계 영역(Critical Section)에 진입하기 위하여 트랜잭션(Transaction) 시작을 신청하면, 상기 제 1 단계에서 생성한 상호 배제 자료에 대하여 수정 연산을 수행함으로써, 특정한 프로세스에게 뮤텍스를 할당하는 제 2 단계; 및 상기 제 2 단계에서 뮤텍스를 할당받은 프로세스만이 상기 공유 자료에 대하여 트랜잭션을 수행하는 제 3 단계를 포함하여 이루어진 것을 특징으로 하는 분산 데이터베이스 프로그램 간의 동기화를 위한 임계 영역 진입 방법이 제공된다.According to the present invention for achieving the object as described above, the first step of generating mutual exclusion data for mutual exclusion (Mutex) in the shared material; When several processes apply to start a transaction to enter a critical section, a mutex is assigned to a specific process by performing a modification operation on the mutual exclusion data generated in the first step. A second step of doing; And a third step of performing a transaction with respect to the shared data only in a process to which a mutex has been allocated in the second step.
또한, 컴퓨터에, 공유 자료에 상호 배제(Mutex)를 위한 상호 배제 자료를 생성하고, 상기 공유 자료가 삭제되면, 생성된 상호 배제 자료도 삭제하는 제 1 단계; 여러개의 프로세스(Process)가 임계 영역(Critical Section)에 진입하기 위하여 트랜잭션(Transaction) 시작을 신청하면, 상기 제 1 단계에서 생성한 상호 배제 자료에 대하여 수정 연산을 수행함으로써, 특정한 프로세스에게 뮤텍스를 할당하는 제 2 단계; 상기 제 2 단계에서 뮤텍스를 할당받은 프로세스만이 상기 공유 자료에 대하여 트랜잭션을 수행하는 제 3 단계; 및 상기 뮤텍스를 할당받은 프로세스의 트랜잭션이 종료되면, 상기 제 2 단계로 복귀하는 제 4 단계를 포함하여 이루어진 것을 실행시킬 수 있는 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체가 제공된다.The method may further include generating, at the computer, mutual exclusion data for mutual exclusion (Mutex) in the shared material, and deleting the generated mutual exclusion data if the shared material is deleted; When several processes apply to start a transaction to enter a critical section, a mutex is assigned to a specific process by performing a modification operation on the mutual exclusion data generated in the first step. A second step of doing; A third step of performing a transaction with respect to the shared material only in a process assigned a mutex in the second step; And a fourth step of returning to the second step when the transaction of the process to which the mutex has been allocated is terminated, is provided with a computer-readable recording medium having recorded thereon a program capable of executing the program.
아래에서, 본 발명에 따른 양호한 일 실시예를 첨부한 도면을 참조로 하여 상세히 설명하겠다.In the following, with reference to the accompanying drawings, a preferred embodiment according to the present invention will be described in detail.
도 1은 본 발명에 적용되는 분산 데이터베이스 프로그램간의 동기화를 위한 시스템의 개략적인 구성도로서, 이를 상세히 설명하면 다음과 같다.1 is a schematic configuration diagram of a system for synchronization between distributed database programs applied to the present invention.
공유 자원(150)인 데이터베이스(160)에 네트워크(140)를 통하여 연결된 여러 프로세스(110, 120, 130)가 동시에 상기 데이터베이스(160)에 접근할 때에는 공유 자원에 대한 상호배타적 접근 관리가 필요하다. 상기 프로세스(110, 120, 130)는 서로 다른 운영 체제 또는 다른 프로그래밍 언어로 구현되어 있을 수 있다. 이러한 프로세스 간의 상호배타적 관리를 위하여 데이터베이스 공유 자원에 상호배제(Mutex)를 두고, 데이터베이스 관리 시스템의 트랜잭션(Transaction) 관리 기능을 사용하여 상호배타적 실행을 구현하게 된다.When multiple processes (110, 120, 130) connected through a network 140 to a database (160), which is a shared resource (150), access the database (160) at the same time, mutually exclusive access management for shared resources is required. The processes 110, 120, and 130 may be implemented in different operating systems or different programming languages. For mutual management of these processes, mutualx is placed on database shared resources, and mutually exclusive execution is implemented using the transaction management function of the database management system.
도 2는 공유 자료에 상호 배제를 표현하는 방법을 개념적으로 나타낸 도면으로서, 이를 상세히 설명하면 다음과 같다.2 is a diagram conceptually illustrating a method of expressing mutual exclusion in shared materials, which will be described in detail as follows.
공유 자료(220)에 상호 배제(210)를 위한 추가 데이터베이스 객체를 생성하여, 이를 상기 공유 자료(220)와 같이 관리한다. 사용자가 정의한 자료가 생성될 때, 추가로 상기 상호 배제(210) 자료를 생성하고, 사용자 정의 자료가 삭제될 경우, 상기 상호 배제(210) 자료도 같이 삭제한다. 상기 상호 배제(210)는 독립된 객체로 구현하거나 사용자 정의 객체를 하나 더 생성하여 사용할 수 있다. 생성되는 자료의 구조는 어떠한 자료형이든 관계없이 하나 이상의 필드(Field)만 가지면 된다.An additional database object for mutual exclusion 210 is created in the shared material 220 and managed as in the shared material 220. When the user-defined data is generated, the mutual exclusion 210 data is further generated, and when the user-defined data is deleted, the mutual exclusion 210 data is also deleted. The mutual exclusion 210 may be implemented as an independent object or may create and use one more user-defined object. The structure of the generated data need only have one or more fields, regardless of any data type.
상기 상호 배제(210) 자료를 사용하여 임계 영역을 관리하는 수순은 세마포어 등과 같은데, 임계 영역이란 상기 상호 배제(210) 자료에 의해서 보호되는 프로그램의 일부분으로서, 이 영역에서 공유 자료에 대한 연산을 수행한다.The procedure for managing a critical region using the mutual exclusion 210 data is the same as a semaphore. The critical region is a part of a program protected by the mutual exclusion 210 data and performs operations on shared data in this region. do.
도 3은 본 발명의 일 실시예에 따른 분산 데이터베이스 프로그램간의 동기화를 위한 임계 영역 진입 방법을 나타낸 흐름도로서, 이를 상세히 설명하면 다음과 같다.3 is a flowchart illustrating a critical region entry method for synchronization between distributed database programs according to an embodiment of the present invention.
먼저, 스텝 S310에서, 데이터베이스 응용 프로그램이 임계 영역에 진입하기 위하여는 트랜잭션 시작을 DBMS(DataBase Management System)에게 알려야 한다. 이때 트랜잭션 독립 수준(Transaction Isolation Level)은 어떤 것이든 가능하다. 여기까지는 여러개의 프로세스가 동시에 수행된다.First, in step S310, the database application program should inform the DBMS (Database Management System) of the start of a transaction in order to enter the critical area. At this point, the transaction isolation level can be anything. Up to this point, several processes are running simultaneously.
이어서, 스텝 S320에서, 상호 배제를 획득하고, 스텝 S330에서, 획득된 상호 배제를 이용하여 공유 자원에 접근한 후, 스텝 S340에서, 트랜잭션을 종료하게 된다. 이때, 실제로 하나의 프로세스만 실행되는 곳은 상호 배제 획득 부분이다. 즉, 공유 자료에 정의한 상호 배제 자료에 대해서 DBMS가 수정 연산을 수행하는 것이 뮤텍스를 획득하는 것이 된다. 동시에 여러개의 프로세스가 공유 자료의 상호 배제에 대해서 수전 연산을 수행할 수 있지만, 그 중 오직 하나만이 성공하고 나머지 프로세스는 뮤텍스를 획득한 프로세스가 트랜잭션 종료를 수행할 때까지 기다려야 한다.Then, in step S320, mutual exclusion is obtained, and in step S330, the shared resource is accessed using the obtained mutual exclusion, and then in step S340, the transaction is terminated. At this time, where only one process is actually executed is the mutual exclusion acquisition part. In other words, when a DBMS performs a modification operation on mutual exclusion data defined in shared data, a mutex is acquired. Multiple processes can simultaneously perform faucet operations on mutual exclusion of shared data, but only one of them must succeed and the other process must wait for the process that acquired the mutex to complete the transaction.
따라서, 뮤텍스 획득과 트랜잭션 종료 사이의 프로그램 코드는 오직 하나의 프로세스만이 수행한다. 이러한 효과는 DBMS의 동시성 제어(Concurrency Control) 기법과 트랜잭션 관리 기법을 적용한 결과이다. 트랜잭션 독립 수준에 관계없이 트랜잭션이 시작된 후, 수정한 공유 자료에 대해서는 배타적 잠금(Exclusive Lock)을 트랜잭션이 끝날 때까지 유지하고 있으므로, 배타적 잠금이 설정된 자료에 대해서 다른 트랜잭션이 수정 작업을 수행할 수 없고, 배타적 잠금이 해제될 때까지 기다려야 한다.Thus, the program code between mutex acquisition and transaction termination only executes one process. This effect is the result of applying the concurrency control technique and the transaction management technique of the DBMS. Regardless of the level of transaction independence, after a transaction has started, an exclusive lock is held on modified shared data until the end of the transaction, so no other transaction can modify the data on which the exclusive lock has been set. However, it must wait until the exclusive lock is released.
여러 상용 DBMS가 트랜잭션 독립 수준 중 직렬화(Serializable) 기능으로 트랜잭션간의 상호 배타적 수행을 지원하고 있으나, 동시성이 현저히 저하되고 공유 자료의 지역화(Localize)가 불가능하다. 예를 들어, 관계형 데이터베이스는 하나의 테이블의 서로 다른 영역에 접근하는 여러 프로세스에 대하여 한번에 하나의 프로세스만 접근을 허용한다. 그러나, 본 발명에서 제안하고 있는 방법을 사용하면 이와 같은 문제점을 피할 수 있다.Although several commercial DBMSs support mutually exclusive execution of transactions with serializable functions among transaction independence levels, concurrency is greatly degraded and localization of shared data is impossible. For example, a relational database allows only one process at a time to access multiple processes that access different areas of a table. However, this problem can be avoided by using the method proposed by the present invention.
한편, SQL(Structured Query Language, 구조화 질의어) 표준에 따라 트랜잭션의 직렬화의 의미가 정의되어 있지만, DBMS마다 수행되는 현상이 다르게 나타나므로, 일반적인 상호배타적 수행에 적용할 수 없다.On the other hand, although the semantics of transaction serialization are defined according to the SQL (Structured Query Language) standard, it is not applicable to general mutually exclusive execution because the phenomenon that is performed for each DBMS is different.
또한, 객체 지향 DBMS를 사용할 경우는 직렬화 기능이 없으므로, 본 발명에서 제시한 방법을 사용해야만 한다.In addition, when using an object-oriented DBMS, there is no serialization function, so the method proposed in the present invention should be used.
상기와 같은 본 발명은 컴퓨터로 읽을 수 있는 기록 매체로 기록되고, 컴퓨터에 의해 처리될 수 있다.The present invention as described above is recorded on a computer-readable recording medium, and can be processed by a computer.
앞서 상세히 설명한 바와 같이 본 발명은 동시 다중 사용자 환경에서 공유 자원에 대한 배타적 수행을 제어함으로써, 공유 자원의 무결성을 유지할 수 있는 효과가 있다.As described in detail above, the present invention has the effect of maintaining the integrity of shared resources by controlling exclusive performance of shared resources in a simultaneous multi-user environment.
또한, 본 발명에 따라 작성된 데이터베이스 응용 프로그램은 자료의 무결성이 보장됨으로써, 자료의 유지 및 보수 비용이 절감되고, 프로그램의 신뢰성도 매우 증가되는 효과가 있다.In addition, the database application program created according to the present invention is guaranteed by the integrity of the data, it is possible to reduce the cost of maintenance and repair of the data, the program reliability is also very effective.
또한, 상호 배제를 위한 장치를 공유 영역인 데이터베이스에 두었기 때문에, 프로세스들이 네트워크 상에 분산될 수 있고, DBMS의 기능을 이용하므로 별도의 장치가 필요없다는 효과가 있다.In addition, since a device for mutual exclusion is placed in a database, which is a shared area, processes can be distributed over a network, and there is no need for a separate device because it uses the function of a DBMS.
이상에서 본 발명에 대한 기술 사상을 첨부 도면과 함께 서술하였지만 이는 본 발명의 가장 양호한 일 실시예를 예시적으로 설명한 것이지 본 발명을 한정하는 것은 아니다. 또한, 이 기술 분야의 통상의 지식을 가진 자이면 누구나 본 발명의 기술 사상의 범주를 이탈하지 않는 범위 내에서 다양한 변형 및 모방이 가능함은 명백한 사실이다.The technical spirit of the present invention has been described above with reference to the accompanying drawings, but this is by way of example only and not by way of limitation to the present invention. In addition, it is obvious that any person skilled in the art may make various modifications and imitations without departing from the scope of the technical idea of the present invention.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019990054158A KR20010053691A (en) | 1999-12-01 | 1999-12-01 | Method for entering critical section for synchronizing distributed database applications |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019990054158A KR20010053691A (en) | 1999-12-01 | 1999-12-01 | Method for entering critical section for synchronizing distributed database applications |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20010053691A true KR20010053691A (en) | 2001-07-02 |
Family
ID=19622953
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1019990054158A KR20010053691A (en) | 1999-12-01 | 1999-12-01 | Method for entering critical section for synchronizing distributed database applications |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20010053691A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101375794B1 (en) * | 2012-01-27 | 2014-03-18 | 네이버비즈니스플랫폼 주식회사 | Method and device for improving performance of database |
KR20200117405A (en) * | 2019-04-04 | 2020-10-14 | 한국전자통신연구원 | Distributed sysetm for managing distributed lock and operating method thereof |
-
1999
- 1999-12-01 KR KR1019990054158A patent/KR20010053691A/en not_active Application Discontinuation
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101375794B1 (en) * | 2012-01-27 | 2014-03-18 | 네이버비즈니스플랫폼 주식회사 | Method and device for improving performance of database |
KR20200117405A (en) * | 2019-04-04 | 2020-10-14 | 한국전자통신연구원 | Distributed sysetm for managing distributed lock and operating method thereof |
US11500693B2 (en) | 2019-04-04 | 2022-11-15 | Electronics And Telecommunications Research Institute | Distributed system for distributed lock management and method for operating the same |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Rosenkrantz et al. | System level concurrency control for distributed database systems | |
Sheth et al. | On transactional workflows | |
US8224977B2 (en) | Using local locks for global synchronization in multi-node systems | |
US5940827A (en) | Methods and apparatus for managing a database in a distributed operating environment | |
US4881166A (en) | Method for consistent multidatabase transaction processing | |
EP0723238B1 (en) | Relational database system and method with high data availability during table data restructuring | |
US7769789B2 (en) | High performant row-level data manipulation using a data layer interface | |
US6240413B1 (en) | Fine-grained consistency mechanism for optimistic concurrency control using lock groups | |
EP2378421B1 (en) | Ownership reassignment in a shared-nothing database system | |
JPH09146821A (en) | Method and apparatus for provision of continuous data support with transparency with reference to heterogeneous data type | |
US8176022B1 (en) | Locking protocol using dynamic locks and dynamic shared memory | |
JPH02188833A (en) | Interface for computer system | |
CN102103642B (en) | Data-erasure method based on OLTP, system and graphic data base server | |
JPH03131941A (en) | Method and device for generating access-plan | |
JP2000513857A (en) | Parallel virtual file system | |
KR100439186B1 (en) | Apparatus for synchronizing threads in java virtual machine and method therefor | |
CN113220755B (en) | Method for flexibly generating GraphQL interface based on multi-source data | |
US6487652B1 (en) | Method and apparatus for speculatively locking objects in an object-based system | |
US8655853B2 (en) | System and method for optimizing database transaction termination | |
US7752225B2 (en) | Replication and mapping mechanism for recreating memory durations | |
JP3621433B2 (en) | Database exclusive control method | |
KR20010053691A (en) | Method for entering critical section for synchronizing distributed database applications | |
AU2001272863B2 (en) | Method, system and data structures for implementing nested databases | |
US6289410B1 (en) | Method and system for maintaining consistency of shared objects based upon instance variable locking | |
Ragunathan et al. | Improving the performance of read-only transactions through asynchronous speculation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E601 | Decision to refuse application |