EP1449076A2 - Entry locking for large data structures - Google Patents

Entry locking for large data structures

Info

Publication number
EP1449076A2
EP1449076A2 EP02777701A EP02777701A EP1449076A2 EP 1449076 A2 EP1449076 A2 EP 1449076A2 EP 02777701 A EP02777701 A EP 02777701A EP 02777701 A EP02777701 A EP 02777701A EP 1449076 A2 EP1449076 A2 EP 1449076A2
Authority
EP
European Patent Office
Prior art keywords
lock
value
entry
hashed
values
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.)
Withdrawn
Application number
EP02777701A
Other languages
German (de)
French (fr)
Inventor
Jan Hoogerbrugge
Paul Stravers
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.)
NXP BV
Original Assignee
Koninklijke Philips Electronics NV
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 Koninklijke Philips Electronics NV filed Critical Koninklijke Philips Electronics NV
Priority to EP02777701A priority Critical patent/EP1449076A2/en
Publication of EP1449076A2 publication Critical patent/EP1449076A2/en
Withdrawn legal-status Critical Current

Links

Classifications

    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99938Concurrency, e.g. lock management in shared database

Definitions

  • the invention relates to a method for locking entries using recursive locks, a method for locking entries using non-recursive locks as well as corresponding devices respectively, a computer system, and a computer program product.
  • a data structure may be shared by a plurality of processes which require the same information to perform various tasks. Synchronising access to a shared data structure is a great challenge for the operation of a computer with multiple processors and is especially important whenever multiple processors attempt to update information in the data structure. Without efficient synchronisation the performance of the system including a shared data structure is severely degraded.
  • one processor performs an update of the data structure it is common for the entire data structure to be inaccessible or "locked" to other processors. In other words the non-updating processors must wait- until the data structure is unlocked before the information contained in the structure can be accessed or updated.
  • data processing systems that concurrently perform multiple processes must have means for synchronising access to common resources that are shared by the multiple processors.
  • data processing systems have provided such synchronised access to the shared resources by employing busy-waiting strategies.
  • busy-waiting strategies In a busy- waiting each process makes a request for a resource and wait idle until the result is available. When the result eventually becomes available, an idle process gains access to the resource.
  • This approach provides adequate synchronisation but suffers the drawback that the processor must idle while waiting for the resource.
  • a data structure as a data processing resource has a single memory address which includes a value field for holding values and a lock field for indicating the lock state of the value field at the memory address.
  • This lock field indicates that the value field is locked, no process other than the process that locked the value field may gain access to the value field.
  • the lock state is unlocked any process may gain access to the resource.
  • the value field may hold the data or alternatively it may hold a pointer to a deferred list of lock or unlock requests.
  • each entry in said data structure has a lock that the process has to acquire before it can use the entry exclusively.
  • the entry of the data structure has been used by said process, it has to release the lock again, so that other processes may access said entry.
  • the process has to perform some operation on a number of entries, it will usually have to acquire all the locks for performing said operation and release the locks afterwards. The acquiring of the locks has to be done in a fixed order to avoid the deadlock.
  • the lock may be the Boolean variable representing the state - locked or not locked - but often also contains a list of other processes that are blocked by the lock.
  • a data structure of N entries needs N locks.
  • the locks may be part of the data structure or may be stored in a separate data structure.
  • a lock table is a sequence of objects, called lock table entries. The number of lock table entries is determined when the table is created. The lock table entries are numbered from 0 to the lock table entry count less one.
  • US 5,339,427 is related to a lock management means for supporting a distributed locking protocol used by a plurality of sharing lock managements executed on processes having access to the shared memory.
  • the request to lock a resource shared among the lock managers is first checked against a local hash table and then if necessary forwarded to the system lock management means SLM.
  • Said SLM provides an interface for the locking and recovery of entries in a shared data structure.
  • a control structure of the SLM is comprised of a hash table and control blocks chained from the hash table entries which represent the status of serialised resources.
  • the SLM associates a lock table entry with each hash table entry.
  • the hash table value indicates which entry in the hash table is to be used to manage serialisation of a specific resource.
  • the locks are put in an open hash table by putting them in a chain. According to the hashed value it is determined or decided which chain to used.
  • Hashing is a well known technique for the transformation of a string of characters into a usually shorter fixed-length value or key that represents the original string. Hashing is used to index and retrieve items in a database because it is faster to find the item using the shorter hashed key than to find it using the original value.
  • the hash function is used to index the original value or key and then used later each time the data associated with the value or key is to be retrieved. Thus, hashing is always a one-way operation.
  • a good hash function also should not produce the same hash value from two different inputs. If it does, this is known as a collision. However, a hash function that offers an extremely low risk of collision may be considered acceptable.
  • the object is solved by a method for locking entries using recursive locks according to claim 1 ; a method for locking entries using non-recursive locks according to claim 2 as well as corresponding devices according to claims 4 and 5, respectively.
  • the invention is based on the idea that for a large data structure with N entries, memory space for the locks corresponding to said entries can be saved by performing a hashing function on a value that represents an entry into a hashed value 1 to M. This hashed value is used to index the table of M locks.
  • the value of M is typically much smaller than the value of N thereby reducing memory space requirements. If M is chosen large enough and a good hashing function is selected problems with collisions will be very small.
  • problems relating to deadlock occurring, when the hashed value of a second entry equals the hashed value of the a first entry, are being addressed by swapping said hashed values of said first and second entry, when the hashed value of the second entry is smaller than the hashed value of the first entry.
  • a first process acquires are first lock corresponding to said first hashed value and a second process acquires are second lock corresponding to said second hashed value.
  • Said first and second process are granted exclusive access to said first and second entry in said data structure after having acquired said first and second lock, respectively.
  • Said first and second process perform the necessary processing and releases said first and second lock again thereafter, so that other processes may access said entries.
  • the value M is proportional to the multiplication of the number of processes which are simultaneously accessing the data structure with the number of entries that said processes averagely need to lock in order to carry out their processing.
  • a computer system according to claim 6 is also provided.
  • Fig. 1 shows a block diagram of the device for locking entries in the data structure.
  • Fig 1 a block diagram of a device for locking entries in the large data structure is shown.
  • Said device comprises hashing means 10, a comparing means 20, a swapping means 30, a first lock acquiring means 40, a second lock acquiring means 50, a accessing permission means 60, and a lock releasing means 70.
  • Said hashing means 10 receives values that represent the entries in said data structure as input signals and outputs the hashed values of said input signals to said comparing means 20 and said swapping means 30.
  • Said comparing means 20 outputs the comparison result of said input signals to said swapping means 30.
  • Said swapping means 30 receives the comparison result from said comparing means 20 as well as the output signals from said hashing means 10 and outputs hashed values to said first the lock acquiring means 40 and said second lock acquiring means 50.
  • Said first and second lock acquiring means 40, 50 are connected to said first and second processes, respectively and to said accessing permission means 60 which in turns is connected to the first and second process as well as to the lock releasing means 70.
  • Said lock releasing means 70 is also connected to said first process and said second process.
  • Said hashing means 10 receives a value representing said first entry el and a value representing the second entry e2 as input signals. Said hashing means 10 performs the hashing function on said received values representing said first and second entry el, e2 into a first and a second hashed value i, j, between 1 and M. Said hashed values are used to index a table of M locks. Said comparing means 20 receives said first and second hashed values i, j, compares the values thereof, and outputs a comparison result.
  • Said swapping means 30 receives the comparison result from said comparing means 20 as well as said first and second hashed values i, j and swaps said first and second hashed values i, j, if said second value j is smaller than said first value i according to the comparison result from said comparing means 20.
  • the swapping of said first and second hashed values is performed when said second value j is smaller than said first value i, in order to avoid deadlock when said first hashed value equals said second hashed value.
  • said swapping means 30 outputs said first hashed value i to said first lock acquiring means 40 and said second hashed value j to said second lock acquiring means 50.
  • Said first lock acquiring means 40 enables a first process to acquire a first lock lock(i) for said first entry el corresponding to said first hashed value i.
  • Said second lock acquiring means 50 enables a second process to acquire a second lock lock(j) for said second entry e2 corresponding to the second hashed value j.
  • Said accessing permission means 60 grants an exclusive access for said first process to said first entry el on the basis of the acquired first lock lock(i) and an exclusive access for said second process to said second entry e2 on the basis of the acquired second lock lock(i).
  • said first and second processes can perform the required processing on the first and second entries el, e2 in said data structure.
  • said first and second processes have performed the processing on said first and second entries el, e2
  • said first and second processes are required to release said first and second locks lock(i), lock(j) of said first and second entry el, e2.
  • Said lock releasing means 70 enables said first and second process to release said first and second lock lock(i), lock(j) on said first and second entry el, e2.
  • non-recursive locks are being used, which can not be locked multiple times by the same process.
  • Said second lock acquiring means 50 is furthermore connected to said comparing means 20.
  • Said lock releasing means 70 is furthermore connected to said comparing means 20; and said hashing means 10 receives a value representing said first entry el and a value representing the second entry e2 as input signals.
  • Said hashing means 10 performs the hashing function on said received values representing said first and second entry el, e2 into a first and a second hashed value i, j, between 1 and M. Said hashed values are used to index a table of M locks.
  • Said comparing means 20 receives said first and second hashed values i, j, compares the values thereof, and outputs a comparison result.
  • Said swapping means 30 receives the comparison result from said comparing means 20 as well as said first and second hashed values i, j and swaps said first and second hashed values i, j, if said second value j is smaller than said first value i according to the comparison result from said comparing means 20.
  • the swapping of said first and second hashed values is performed when said second value j is smaller than said first value i, in order to avoid deadlock when said first hashed value equals said second hashed value.
  • said swapping means 30 outputs said first hashed value i to said first lock acquiring means 40 and said second hashed value j to said second lock acquiring means 50.
  • Said first lock acquiring means 40 enables a first process to acquire first lock lock(i) for said first entry el corresponding to said first hashed value i.
  • Said second lock acquiring means 50 enables a second process to acquire a second lock lock(j) for said second entry e2 corresponding to the second hashed value j , when said second hashed value j does not equal said first hashed value i.
  • Said accessing permission means 60 grants an exclusive access for said first process to said first entry el on the basis of the acquired first lock lock(i) and an exclusive access for said second process to said second entry e2 on the basis of the acquired second lock lock(j).
  • said first and second processes can perform the required processing on the first and second entries el, e2 in said data structure.
  • said first and second processes are required to release said first and second locks of said first and second entry el, e2.
  • Said lock releasing means 70 enables said first process to release said first lock lock(i) on said first entry el, and said second process to release said second lock lock(j) on said second entry e2, if said second hashed value j does not equal said first hashed value I as determined by the comparing means 20.
  • the value of M is proportional to the multiplication of the number of processes which are simultaneously accessing the data structure with the number of entries that said processes averagely need to lock in order to carry out their processing.
  • Said device for locking entries is preferably used in a computer system which is capable of concurrent processing and of handling multiple processes.
  • a computer system which is capable of concurrent processing and of handling multiple processes.

Abstract

The invention is based on the idea that for a large data structure with N entries, memory space for the locks corresponding to said entries can be saved by performing a hashing function on a value that represents an entry into a hashed value 1 to M. This hashed value is used to index the table of M locks. The value of M is typically much smaller than the value of N thereby reducing memory space requirements. If M is chosen large enough and a good hashing function is selected problems with collisions will be very small. Additionally, problems relating to deadlock occurring, when the hashed value of a second entry equals the hashed value of the a first entry, are being addressed by swapping said hashed values of said first and second entry, when the hashed value of the second entry is smaller than the hashed value of the first entry.

Description

Entry locking for large data structures
The invention relates to a method for locking entries using recursive locks, a method for locking entries using non-recursive locks as well as corresponding devices respectively, a computer system, and a computer program product.
To enhance operating efficiency, a data structure may be shared by a plurality of processes which require the same information to perform various tasks. Synchronising access to a shared data structure is a great challenge for the operation of a computer with multiple processors and is especially important whenever multiple processors attempt to update information in the data structure. Without efficient synchronisation the performance of the system including a shared data structure is severely degraded. When one processor performs an update of the data structure it is common for the entire data structure to be inaccessible or "locked" to other processors. In other words the non-updating processors must wait- until the data structure is unlocked before the information contained in the structure can be accessed or updated.
Therefore, data processing systems that concurrently perform multiple processes must have means for synchronising access to common resources that are shared by the multiple processors. Typically, data processing systems have provided such synchronised access to the shared resources by employing busy-waiting strategies. In a busy- waiting each process makes a request for a resource and wait idle until the result is available. When the result eventually becomes available, an idle process gains access to the resource. This approach provides adequate synchronisation but suffers the drawback that the processor must idle while waiting for the resource.
A data structure as a data processing resource has a single memory address which includes a value field for holding values and a lock field for indicating the lock state of the value field at the memory address. When this lock field indicates that the value field is locked, no process other than the process that locked the value field may gain access to the value field. When the lock state is unlocked any process may gain access to the resource. The value field may hold the data or alternatively it may hold a pointer to a deferred list of lock or unlock requests. These two kinds of values share the use of the value field to optimise efficiency. They can share the same value field because they will never be stored in the value field at the same time. The nature of the two values makes them inherently mutually exclusive. Alternatively, the pointer does not share the value field with data but is rather stored in a separate field that is distinct from the value field.
In a large data structure with a large number of entries which need to be accessed from multiple processes, each entry in said data structure has a lock that the process has to acquire before it can use the entry exclusively. When the entry of the data structure has been used by said process, it has to release the lock again, so that other processes may access said entry. If the process has to perform some operation on a number of entries, it will usually have to acquire all the locks for performing said operation and release the locks afterwards. The acquiring of the locks has to be done in a fixed order to avoid the deadlock.
The lock may be the Boolean variable representing the state - locked or not locked - but often also contains a list of other processes that are blocked by the lock. A data structure of N entries needs N locks. The locks may be part of the data structure or may be stored in a separate data structure. A lock table is a sequence of objects, called lock table entries. The number of lock table entries is determined when the table is created. The lock table entries are numbered from 0 to the lock table entry count less one.
US 5,339,427 is related to a lock management means for supporting a distributed locking protocol used by a plurality of sharing lock managements executed on processes having access to the shared memory. The request to lock a resource shared among the lock managers is first checked against a local hash table and then if necessary forwarded to the system lock management means SLM. Said SLM provides an interface for the locking and recovery of entries in a shared data structure. A control structure of the SLM is comprised of a hash table and control blocks chained from the hash table entries which represent the status of serialised resources. The SLM associates a lock table entry with each hash table entry. The hash table value indicates which entry in the hash table is to be used to manage serialisation of a specific resource. However, the locks are put in an open hash table by putting them in a chain. According to the hashed value it is determined or decided which chain to used.
Hashing is a well known technique for the transformation of a string of characters into a usually shorter fixed-length value or key that represents the original string. Hashing is used to index and retrieve items in a database because it is faster to find the item using the shorter hashed key than to find it using the original value. The hash function is used to index the original value or key and then used later each time the data associated with the value or key is to be retrieved. Thus, hashing is always a one-way operation. A good hash function also should not produce the same hash value from two different inputs. If it does, this is known as a collision. However, a hash function that offers an extremely low risk of collision may be considered acceptable.
It is an object of the invention to improve entry locking for large data sources accessed from multiple processes.
The object is solved by a method for locking entries using recursive locks according to claim 1 ; a method for locking entries using non-recursive locks according to claim 2 as well as corresponding devices according to claims 4 and 5, respectively.
The invention is based on the idea that for a large data structure with N entries, memory space for the locks corresponding to said entries can be saved by performing a hashing function on a value that represents an entry into a hashed value 1 to M. This hashed value is used to index the table of M locks. The value of M is typically much smaller than the value of N thereby reducing memory space requirements. If M is chosen large enough and a good hashing function is selected problems with collisions will be very small. Additionally, problems relating to deadlock occurring, when the hashed value of a second entry equals the hashed value of the a first entry, are being addressed by swapping said hashed values of said first and second entry, when the hashed value of the second entry is smaller than the hashed value of the first entry.
When recursive locks are being used a first process acquires are first lock corresponding to said first hashed value and a second process acquires are second lock corresponding to said second hashed value. Said first and second process are granted exclusive access to said first and second entry in said data structure after having acquired said first and second lock, respectively. Said first and second process perform the necessary processing and releases said first and second lock again thereafter, so that other processes may access said entries.
When non-recursive lock are being used, the locking of entries will be performed very similar as in the case recursive locks, but a second process will only be able to acquire the second lock corresponding to a second entry, when the first hashed value does not equal the second hashed value. Furthermore the second process will only be able to release the second lock, when the first hashed value does not equal the second hashed value.
In a preferred embodiment of the present invention, the value M is proportional to the multiplication of the number of processes which are simultaneously accessing the data structure with the number of entries that said processes averagely need to lock in order to carry out their processing. According to the invention, a computer system according to claim 6 is also provided.
Furthermore the invention provides a computer program product according to claim 7.
The invention will now be explained in more detail with reference to the drawing, in which:
Fig. 1 shows a block diagram of the device for locking entries in the data structure.
In Fig 1 a block diagram of a device for locking entries in the large data structure is shown. Said device comprises hashing means 10, a comparing means 20, a swapping means 30, a first lock acquiring means 40, a second lock acquiring means 50, a accessing permission means 60, and a lock releasing means 70. Said hashing means 10 receives values that represent the entries in said data structure as input signals and outputs the hashed values of said input signals to said comparing means 20 and said swapping means 30. Said comparing means 20 outputs the comparison result of said input signals to said swapping means 30. Said swapping means 30 receives the comparison result from said comparing means 20 as well as the output signals from said hashing means 10 and outputs hashed values to said first the lock acquiring means 40 and said second lock acquiring means 50. Said first and second lock acquiring means 40, 50 are connected to said first and second processes, respectively and to said accessing permission means 60 which in turns is connected to the first and second process as well as to the lock releasing means 70. Said lock releasing means 70 is also connected to said first process and said second process.
According to the first embodiment of the present invention recursive locks are being used, which can be locked multiple times by the same process. Said hashing means 10 receives a value representing said first entry el and a value representing the second entry e2 as input signals. Said hashing means 10 performs the hashing function on said received values representing said first and second entry el, e2 into a first and a second hashed value i, j, between 1 and M. Said hashed values are used to index a table of M locks. Said comparing means 20 receives said first and second hashed values i, j, compares the values thereof, and outputs a comparison result. Said swapping means 30 receives the comparison result from said comparing means 20 as well as said first and second hashed values i, j and swaps said first and second hashed values i, j, if said second value j is smaller than said first value i according to the comparison result from said comparing means 20. The swapping of said first and second hashed values is performed when said second value j is smaller than said first value i, in order to avoid deadlock when said first hashed value equals said second hashed value. Thereafter, said swapping means 30 outputs said first hashed value i to said first lock acquiring means 40 and said second hashed value j to said second lock acquiring means 50.
Said first lock acquiring means 40 enables a first process to acquire a first lock lock(i) for said first entry el corresponding to said first hashed value i. Said second lock acquiring means 50 enables a second process to acquire a second lock lock(j) for said second entry e2 corresponding to the second hashed value j. Said accessing permission means 60 grants an exclusive access for said first process to said first entry el on the basis of the acquired first lock lock(i) and an exclusive access for said second process to said second entry e2 on the basis of the acquired second lock lock(i).
When said first and second process have acquired said first and second lock(i), lock(j), said first and second processes can perform the required processing on the first and second entries el, e2 in said data structure. When said first and second processes have performed the processing on said first and second entries el, e2, said first and second processes are required to release said first and second locks lock(i), lock(j) of said first and second entry el, e2. Said lock releasing means 70 enables said first and second process to release said first and second lock lock(i), lock(j) on said first and second entry el, e2.
Said first and second entry are now free to be exclusively accessed by other processes.
According to a second embodiment of the present invention non-recursive locks are being used, which can not be locked multiple times by the same process. Said second lock acquiring means 50 is furthermore connected to said comparing means 20. Said lock releasing means 70 is furthermore connected to said comparing means 20; and said hashing means 10 receives a value representing said first entry el and a value representing the second entry e2 as input signals. Said hashing means 10 performs the hashing function on said received values representing said first and second entry el, e2 into a first and a second hashed value i, j, between 1 and M. Said hashed values are used to index a table of M locks. Said comparing means 20 receives said first and second hashed values i, j, compares the values thereof, and outputs a comparison result. Said swapping means 30 receives the comparison result from said comparing means 20 as well as said first and second hashed values i, j and swaps said first and second hashed values i, j, if said second value j is smaller than said first value i according to the comparison result from said comparing means 20. The swapping of said first and second hashed values is performed when said second value j is smaller than said first value i, in order to avoid deadlock when said first hashed value equals said second hashed value. Then, said swapping means 30 outputs said first hashed value i to said first lock acquiring means 40 and said second hashed value j to said second lock acquiring means 50.
Said first lock acquiring means 40 enables a first process to acquire first lock lock(i) for said first entry el corresponding to said first hashed value i. Said second lock acquiring means 50 enables a second process to acquire a second lock lock(j) for said second entry e2 corresponding to the second hashed value j , when said second hashed value j does not equal said first hashed value i. Said accessing permission means 60 grants an exclusive access for said first process to said first entry el on the basis of the acquired first lock lock(i) and an exclusive access for said second process to said second entry e2 on the basis of the acquired second lock lock(j). When said first and second process have acquired said first and second lock(i), lock(j), said first and second processes can perform the required processing on the first and second entries el, e2 in said data structure. When said first and second processes have performed their processing on said first and second entry, said first and second process are required to release said first and second locks of said first and second entry el, e2. Said lock releasing means 70 enables said first process to release said first lock lock(i) on said first entry el, and said second process to release said second lock lock(j) on said second entry e2, if said second hashed value j does not equal said first hashed value I as determined by the comparing means 20.
Said first and the second entry el, e2 are now free to be exclusively accessed by other processes.
Preferably, the value of M is proportional to the multiplication of the number of processes which are simultaneously accessing the data structure with the number of entries that said processes averagely need to lock in order to carry out their processing.
By applying the principles of the present invention it becomes possible to save memory for the locks but the parallelism may be reduced, since accesses to different entries that hashed to the same value are serialised. However, by using a good hashing function and choosing M large enough the reduction parallelism will be very small.
Said device for locking entries is preferably used in a computer system which is capable of concurrent processing and of handling multiple processes. As apparent for a person skilled in the art although only a device for two entries is described above, device with more than two entries can also be arranged according to the principles of the present invention.

Claims

CLAIMS:
1. Method for locking entries, in particular in a large data structure, accessible from multiple processes, wherein recursive locks are being used, comprising the steps of: hashing a first entry (el) to a first value (i) between 1 and M, hashing a second entry (e2) to a second value (j) between 1 and M; - swapping said first and second hashed values ( i; j), if said second value (j) is smaller than said first value (i); acquiring a first lock (lock (i)) corresponding the hashed first value (i) by a first process; acquiring a second lock (lock (j)) corresponding the hashed second value (j) by a second process; wherein said first process is granted an exclusive access said first entry (el) on the basis of the hashed first values (i); and wherein said second process is granted an exclusive accesses said second entry (e2) on the basis of the hashed second values (j); - wherein said first process is enabled to release said first lock (lock (i)) after having executed the processing on said first entry (el), and wherein said second process is enabled to release said second lock (lock (j)) after having executed the processing on said second entry (e2).
2. Method for locking entries, in particular in a large data structure, accessible from multiple processes, wherein non-recursive locks are being used, comprising the steps of: hashing a first entry (el) to a first value (i) between 1 and M, hashing a second entry (e2) to a second value (j) between 1 and M; swapping said first and second hashed values ( i; j), if said second value (j) is smaller than said first value (i); acquiring a first lock (lock (i)) corresponding the hashed first value (i) by a first process; acquiring a second lock (lock (j)) corresponding the hashed second value (j) by a second process, if said first hashed value (i) does not equal said second hashed value; herein said first process is granted an exclusive access said first entry (el) on the basis of the hashed first value (i); and wherein said second process is granted an exclusive access said second entry (e2) on the basis of the hashed second value (j); wherein said first process is enabled to release said first lock (lock (i)) after having executed the processing on said first entry (el), and wherein said second process is enabled to release said second lock (lock (j)) after having executed the processing on said second entry (e2), if said first hashed value (i) does not equal said second value (j).
3. Method according to claim 1 or 2, wherein the value M is proportional to the multiplication of the number of processes which are simultaneously accessing the data structure with the number of entries that said processes averagely need to lock in order to carry out their processing.
4. Device for locking entries, in particular in a large data structure, accessible from multiple processes, wherein recursive locks are being used, comprising : hashing means (10) for hashing a first entry (el) to a first value (i) between 1 and M, and a second entry (e2) to a second value (j) between 1 and M; - comparing means (20) for comparing said first and second hashed values (i, j) swapping means (30) for swapping said first and second hashed values ( i; j), if said comparing means (20) has determined that said second value (j) is smaller than said first value (i); first lock acquiring means (40) for enabling a first process to acquire a first lock (lock (i)) corresponding to the hashed first value (i) by; second lock acquiring means (50) for enabling a second process to acquire a second lock (lock (j)) corresponding to the hashed second value (j); accessing permission means (60) for granting exclusive access of said first process to said first entry (el) on the basis of the hashed first value (i); and for granting exclusive access of said second process to said second entry (e2) on the basis of the hashed second value (j); lock releasing means (70) for enabling said first process to release said first lock (lock (i)) after having executed the processing is on said first entry (el), and for enabling said second process to release said second lock (lock (j)) after having executed the processing on said second entry (e2).
5. Device for locking entries, in particular in a large data structure, accessible from multiple processes, wherein non-recursive locks are being used, comprising: hashing means (10) for hashing a first entry (el) to a first value (i) between 1 and M, and a second entry (e2) to a second value (j) between 1 and M; comparing means (20) for comparing said first and second hashed values (i, j) swapping means (30) for swapping said first and second hashed values ( i; j), if said comparing means (20) has determined that said second value (j) is smaller than said first value (i); first lock acquiring means (40) for enabling a first process to acquire a first lock (lock (i)) corresponding to the hashed first value (i) by; second lock acquiring means (50) for enabling a second process to acquire a second lock (lock (j)) corresponding to the hashed second value (j), if said comparing means (20) has determined, that said first hashed value (i) does not equal said second hashed value
(j); accessing permission means (60) for granting exclusive access of said first process to said first entry (el) on the basis of the hashed first values (i); and for granting exclusive access of said second process to said second entry (e2) on the basis of the hashed second values (j); lock releasing means (70) for enabling said first process to release said first lock (lock (i)) after having executed the processing is on said first entry (el), and for enabling said second process to release said second lock (lock (j)) after having executed the processing on said second entry (e2), if said comparing means (20) has determined, that said first hashed value (i) does not equal said second value (j).
6. Computer system for concurrent processing with a data structure comprising N entries, comprising: - a device for locking entries, in particular in a large data structure, accessible from multiple processes, using recursive locks according to claim 4, and/or a device for locking entries, in particular in a large data structure, accessible from multiple processes, using non-recursive locks according to claim 5.
7. Computer program product comprising computer program code means for causing a computer to perform the steps of the method as claimed 1, 2 or 3.
EP02777701A 2001-11-13 2002-10-28 Entry locking for large data structures Withdrawn EP1449076A2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP02777701A EP1449076A2 (en) 2001-11-13 2002-10-28 Entry locking for large data structures

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
EP01204330 2001-11-13
EP01204330 2001-11-13
PCT/IB2002/004531 WO2003042816A2 (en) 2001-11-13 2002-10-28 Entry locking for large data structures
EP02777701A EP1449076A2 (en) 2001-11-13 2002-10-28 Entry locking for large data structures

Publications (1)

Publication Number Publication Date
EP1449076A2 true EP1449076A2 (en) 2004-08-25

Family

ID=8181224

Family Applications (1)

Application Number Title Priority Date Filing Date
EP02777701A Withdrawn EP1449076A2 (en) 2001-11-13 2002-10-28 Entry locking for large data structures

Country Status (6)

Country Link
US (1) US7051136B2 (en)
EP (1) EP1449076A2 (en)
JP (1) JP2005509944A (en)
CN (1) CN1266602C (en)
AU (1) AU2002339651A1 (en)
WO (1) WO2003042816A2 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7370048B2 (en) * 2005-05-27 2008-05-06 International Business Machines Corporation File storage method and apparatus
US8533158B1 (en) 2006-09-28 2013-09-10 Emc Corporation Reclaiming data space by rewriting metadata
US7526623B1 (en) * 2006-09-28 2009-04-28 Emc Corporation Optimizing reclamation of data space
US7756831B1 (en) * 2006-09-28 2010-07-13 Emc Corporation Cooperative locking between multiple independent owners of data space
US8862639B1 (en) 2006-09-28 2014-10-14 Emc Corporation Locking allocated data space
US7647466B1 (en) * 2006-09-28 2010-01-12 Emc Corporation Linear space allocation mechanisms in data space
US9454536B1 (en) 2006-09-28 2016-09-27 Emc Corporation Space compaction and defragmentation mechanisms in data space
US7660956B1 (en) * 2007-01-08 2010-02-09 Emc Corporation Save set bundling for staging
US7822927B1 (en) * 2007-05-14 2010-10-26 Emc Corporation Dynamically configurable reverse DNLC lookup
EP3138013B1 (en) * 2014-04-30 2019-02-27 Oracle International Corporation System and method for providing distributed transaction lock in transactional middleware machine environment
CN113570460A (en) * 2019-08-30 2021-10-29 创新先进技术有限公司 Method and apparatus for concurrently executing transactions in a blockchain

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4480304A (en) * 1980-10-06 1984-10-30 International Business Machines Corporation Method and means for the retention of locks across system, subsystem, and communication failures in a multiprocessing, multiprogramming, shared data environment
JPH01303527A (en) * 1988-05-31 1989-12-07 Hitachi Ltd Control method for shared resources
US5339427A (en) * 1992-03-30 1994-08-16 International Business Machines Corporation Method and apparatus for distributed locking of shared data, employing a central coupling facility
US5737611A (en) * 1996-04-05 1998-04-07 Microsoft Corporation Methods for dynamically escalating locks on a shared resource
US6360220B1 (en) * 1998-08-04 2002-03-19 Microsoft Corporation Lock-free methods and systems for accessing and storing information in an indexed computer data structure having modifiable entries
US6529905B1 (en) * 2000-01-11 2003-03-04 Frontline Solutions, Inc. Method and system for allowing multiple users to edit a hierarchical data structure

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See references of WO03042816A2 *

Also Published As

Publication number Publication date
CN1610884A (en) 2005-04-27
AU2002339651A1 (en) 2003-05-26
WO2003042816A2 (en) 2003-05-22
US20040267745A1 (en) 2004-12-30
JP2005509944A (en) 2005-04-14
WO2003042816A3 (en) 2004-03-18
CN1266602C (en) 2006-07-26
US7051136B2 (en) 2006-05-23

Similar Documents

Publication Publication Date Title
US10176222B2 (en) Query plan optimization for prepared SQL statements
Kung et al. On optimistic methods for concurrency control
US7783627B2 (en) Database retrieval with a unique key search on a parallel computer system
US20050102255A1 (en) Computer-implemented system and method for handling stored data
US5333318A (en) Creating and searching a quad linked list in a trunked communication system
US5263161A (en) Non-busy waiting resource control
EP0682312A2 (en) Hardware implemented locking mechanism for parallel/distributed computer system
US11294737B2 (en) Self-managed lock access
US7051136B2 (en) Entry locking for large data structures
US7043478B2 (en) Asynchronous database updates
US20170139745A1 (en) Scaling priority queue for task scheduling
US6185650B1 (en) High performance locking facility
US20030041227A1 (en) Distributed database system
US20040088573A1 (en) Method and apparatus for providing dynamic locks for global resources
US6253274B1 (en) Apparatus for a high performance locking facility
US6088757A (en) Computer program means and device for conducting high performance locking facility in a loosely coupled environment
CN108139927A (en) The routing based on action of affairs in online transaction processing system
US20070130144A1 (en) Method and system for concurrent processing of list items
EP0286807A2 (en) Method for regulating access by concurrent transactions to resources
Gupta Deadlock detection techniques in distributed database system
JPH0619769A (en) Record lock control method
EP0483250A1 (en) Non-busy-waiting resource control.
Lubowich et al. On the performance of distributed lock-based synchronization?
Ali OR parallel execution of Horn clause programs based on WAM and shared control information
JPH03138751A (en) Method of controlling resource

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

AK Designated contracting states

Kind code of ref document: A2

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FI FR GB GR IE IT LI LU MC NL PT SE SK TR

AX Request for extension of the european patent

Extension state: AL LT LV MK RO SI

17P Request for examination filed

Effective date: 20040920

RAP1 Party data changed (applicant data changed or rights of an application transferred)

Owner name: NXP B.V.

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION IS DEEMED TO BE WITHDRAWN

18D Application deemed to be withdrawn

Effective date: 20110503