IP Library › Granted Patent US 8,606,791
Granted Patent B2
US 8,606,791 · App. 13/163,260 · Granted Dec 10, 2013

Concurrently accessed hash table

Inventor: Igor Ostrovsky (Redmond, WA)
Assignee: Microsoft Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,606,791
App. No.
13/163,260
Filed
Jun 17, 2011
Granted
Dec 10, 2013
Kind
B2
Examiner
WONG, LESLIE
Art Unit
2164
USPC
707/803
Abstract

A method of resizing a concurrently accessed hash table is disclosed. The method includes acquiring the locks in the hash table. The hash table, in a first state, is dynamically reconfigured in size into a second state. Additionally, the amount of locks is dynamically adjusted based on comparing the size of the hash table in the second state to the size of the hash table in the second state.

Claims (34)

1. A method of resizing a concurrently accessed hash table, the method comprising:

acquiring a lock of a plurality of locks for the hash table, wherein the lock protects an amount of values in the hash table;

dynamically reconfiguring a size of the hash table in a first state to a size of the hash table in a second state;

counting a total amount of values for each of the plurality of locks and comparing the total amount of values against the amount of values protected by the acquired lock multiplied by an amount of the plurality locks to determine whether to dynamically reconfigure the size of the hash table in the first state; and

dynamically adjusting an amount of the plurality of locks based on comparing the size of the hash table in the first state to the size of the hash table in the second state.

2. The method of claim 1 wherein dynamically reconfiguring the size includes enlarging the hash table.

3. The method of claim 2 wherein dynamically adjusting the amount of the plurality of locks includes adding locks to the hash table.

4. The method of claim 1 wherein dynamically reconfiguring the size of the hash table includes doubling the size of the hash table and wherein dynamically adjusting the amount of the plurality of locks includes doubling the amount of the plurality of locks.

5. The method of claim 4 wherein the each of plurality of locks protects an amount of slot indexes in the first state and wherein each of the plurality of locks of the dynamically adjusted amount of the plurality of locks protects the amount of slot indexes in the second state.

6. The method of claim 1 wherein a determination as to whether to resize the hash table is made as part of adding a value to the hash table.

7. A method of resizing a concurrently accessed hash table, the method comprising:

acquiring a lock of a plurality of locks for the hash table, wherein the lock protects an amount of values in the hash table;

dynamically reconfiguring a size of the hash table based upon comparing the amount of values protected by the acquired lock multiplied by an amount of the plurality locks against an initial size to obtain a new size of the hash table; and

dynamically adjusting the amount of the plurality of locks based on comparing the new size of the hash table against the initial size of the hash table.

8. The method of claim 7 wherein dynamically reconfiguring the size of the hash table includes acquiring the plurality of locks.

9. The method of claim 8 wherein a value is added to the hash table between the acquiring the lock of the plurality of the locks and the acquiring the plurality of locks.

10. The method of claim 9 wherein the value is protected by the acquired lock.

11. The method of claim 8 and further comprising releasing the plurality of locks after dynamically adjusting the amount of the plurality of locks.

12. The method of claim 7 and further comprising counting a total amount of values for each of the plurality of locks and comparing the total amount of values against the amount of values protected by the acquired lock multiplied by an amount of the plurality locks to determine whether to dynamically resize the hash table.

13. The method of claim 7 wherein dynamically reconfiguring the size of the hash table includes creating a new table from the hash table, and copying values from the hash table into the new hash table.

14. The method of claim 7 wherein the hash table includes a plurality of slots, wherein an amount of the plurality of slots is related to the size of the hash table, and each slot includes a node, wherein each node can store a value.

15. The method of claim 14 wherein the plurality of locks protect the plurality of slots.

16. The method of claim 7 wherein the hash table is enlarged during the dynamically reconfiguring the size of the hash table, and the amount of locks is increased during the dynamically adjusting the amount of the plurality of locks.

17. A computer readable storage medium storing computer executable instructions for controlling a computing device configured to perform a method of resizing a hash table, the method comprising:

generating a hash table as a plurality of slot indexes wherein each slot index includes a node, wherein each of the nodes is configured to contain a value, wherein the hash table is accessible by a plurality of concurrent threads of an application;

acquiring a lock of a plurality of locks for the hash table, wherein the lock protects an amount of values in the hash table from concurrent access of the values;

acquiring a remainder of the plurality of locks for the hash table to protect the hash table from access;

dynamically adding slot indexes to the hash table based upon comparing the amount of values protected by the acquired lock multiplied by an amount of the plurality locks against an initial size to obtain a new size of the hash table;

reassigning some of the values to correspond with additional slot indexes;

dynamically adjusting the amount of the plurality of locks based on comparing the new size of the hash table against the initial size of the hash table; and

reassigning the plurality of locks to accommodate the additional slot indexes.

18. The computer readable medium of claim 17 wherein generating the hash table includes creating a data structure in memory wherein the nodes of the slot index include linked-lists corresponding with each slot index.

19. The computer readable medium of claim 17 wherein the method is performed when a value is added to the hash table.

20. The computer readable medium of claim 19 wherein the acquired lock corresponds with a hash function performed on the value to be added to the hash table.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2014
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034544/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 17, 2011
From: OSTROVSKY, IGOR
To: MICROSOFT CORPORATION
Reel/Frame 026462/0366 →
Continuity (1)
Related Publication 20120323972A1 · Dec 20, 2012