Steadily over time computers have become much more powerful, with more processing power and memory to handle advanced operations. This trend has recently shifted away from a focus on ever-increasing single-processor clock rates and towards an increase in the number of processors available in a single computer. Software developers want to take advantage of improvements in computer processing power, enabling their software programs to be executed faster as new hardware is adopted. With the new hardware trends, however, this requires a different approach: developers must arrange for one or more tasks of a particular software program to be executed “concurrently” (sometimes called “in parallel”), so that the same logical operation can utilize many processors at one time, and deliver better performance as more processors are added to the computers on which such software runs.
Transactional memory is designed to ease development of concurrent programs by providing atomicity and isolation to regions of program code. Transactional memory (TM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. A transaction in the context of transactional memory is a piece of code that executes a series of reads and writes to shared memory. TM is used as an alternative to traditional locking mechanisms. TM allows concurrent programs to be written more simply. A transaction specifies a sequence of code that is supposed to execute as if it were executing in isolation, whereas in reality it executes in a normal multithreaded environment with many concurrent activities. This illusion of isolation may be achieved by fine-grained locking of objects or memory ranges, and by executing in a mode that allows the effects of the transaction to be rolled back if the transaction is discovered to be in conflict with some other transaction. We say that a data access is “transacted” if the access is protected by these locking and rollback mechanisms.
Different locking and versioning mechanisms are possible, including several software-based and hardware-based approaches. Different mechanisms have features and qualities making each suitable or preferable in different situations. Combining different mechanisms within a single process generally is not possible, leading to the selection of generic mechanisms which typically compromise on performance in order to achieve general applicability.
Various technologies and techniques are disclosed for providing a transaction grouping feature for use in programs operating under a transactional memory system. The transaction grouping feature is operable to allow transaction groups to be created that contain related transactions. The transaction groups are used to enhance operation of the programs. Transaction groups are defined such that the transactions in each group are known to operate on disjoint data, which enables incompatible locking and versioning mechanisms within each such group, in turn allowing fine-tuning of the specific mechanisms for each particular group.
This Summary was provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
The technologies and techniques herein may be described in the general context as a transactional memory system, but the technologies and techniques also serve other purposes in addition to these. In one implementation, one or more of the techniques described herein can be implemented as features within a framework program such as MICROSOFT® .NET Framework, or from any other type of program or service that provides platforms for developers to develop software applications. In another implementation, one or more of the techniques described herein are implemented as features with other applications that deal with developing applications that execute in concurrent environments.
In one implementation, a transaction grouping feature is provided for use in programs operating under a transactional memory system. The transaction grouping feature allows transactions to be placed into groups. If it can be determined that a set of transactions access data (e.g. read/write data) which is demonstrably disjoint from the data accessed by any other transactions, then this set can be considered as a “transaction group”.
By the above definition, transactions that are part of a group are known to operate on read/write data which is disjoint from the read/write data accessed by other transactions within other groups. As a result, it becomes possible to implement distinct locking and versioning mechanisms for each such group, allowing each transaction group to leverage specially-selected locking and versioning algorithms most appropriate for the data accessed by the transactions in the group.
In addition to the particular data accessed by the transactions in a group, many other factors can influence the particular selection of locking and versioning algorithms used within a group. For example, the duration of the transactions or the nature of the code within the transactions are two other such factors. In one implementation, locking and versioning mechanisms that are normally incompatible can be used concurrently within a process, leading to potentially increased performance.
Determining when transactions can be grouped can be accomplished through a plurality of means. One implementation may leverage programmer-supplied annotations to demark the groups, as described in
As shown in
Additionally, device 100 may also have additional features/functionality. For example, device 100 may also include additional storage (removable and/or non-removable) including, but not limited to, magnetic or optical disks or tape. Such additional storage is illustrated in
Computing device 100 includes one or more communication connections 114 that allow computing device 100 to communicate with other computers/applications 115. Device 100 may also have input device(s) 112 such as keyboard, mouse, pen, voice input device, touch input device, etc. Output device(s) 111 such as a display, speakers, printer, etc. may also be included. These devices are well known in the art and need not be discussed at length here. In one implementation, computing device 100 includes transactional memory application 200. Transactional memory application 200 will be described in further detail in
Turning now to
Transactional memory application 200 includes program logic 204, which is responsible for carrying out some or all of the techniques described herein. Program logic 204 includes logic for providing a transaction grouping feature that allows related transactions in a particular program to be grouped together 206 (as described below with respect to
Turning now to
Turning now to
Contention management is the mechanism used by a runtime system to select appropriate behavior whenever a conflict is detected between multiple concurrently executing transactions. Contention management decides which of the conflicting transactions, if any, to preserve and which to abort. It further decides how to reschedule execution of the individual transactions such that they can run to completion. Specialized contention management as used herein refers to the ability to apply contention management heuristics which are distinct from the default heuristics of a given runtime.
In one implementation, by applying different policies to different groups, enhanced performance of the program can be achieved. For example, one type of specialized contention management policy can be assigned to a particular transaction group that will give the best performance for the types of operations those transactions contain. Another specialized contention management policy can be assigned to another transaction group that will get the best performance for the types of operations that the other transaction group contains. The process ends at end point 350.
As an example, one transactional memory locking and versioning mechanism can be used with one particular transaction group while another potentially incompatible transactional memory locking and versioning mechanism is used with another transaction group.
Let's look at a non-limiting example to further illustrate how different transactional memory mechanisms can be combined together when there are multiple transaction groups. One transaction group could use a buffered update scheme for versioning, while another group could use an in-place update scheme with undo logging. By grouping transactions, the data can be isolated in ways that enable the combinations of such incompatible transactional memory locking and versioning mechanisms to be used, which may enable improved overall performance. As another example, fast but limited hardware-based transactional memory mechanisms can be used in some transaction groups, while incompatible and slower software transactional memory mechanisms can be used in other transaction groups when the hardware limitations are not acceptable for the transactions of the group.
While the previous hypothetical example just mentioned using this technique with two transaction groups, the concept can be used with more than two groups and with various combinations of transactional memory locking and versioning mechanisms, including both hardware and software approaches
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. All equivalents, changes, and modifications that come within the spirit of the implementations as described herein and/or by the following claims are desired to be protected.
For example, a person of ordinary skill in the computer software art will recognize that the examples discussed herein could be organized differently on one or more computers to include fewer or additional options or features than as portrayed in the examples.
This application is a continuation of, and claims benefit from, U.S. application Ser. No. 11/824,379, filed Jun. 29, 2007, which is incorporated by reference in its entirety.
Number | Name | Date | Kind |
---|---|---|---|
5157777 | Lai et al. | Oct 1992 | A |
5999987 | O'Farrell et al. | Dec 1999 | A |
6085035 | Ungar | Jul 2000 | A |
6105147 | Molloy | Aug 2000 | A |
6138269 | Ball | Oct 2000 | A |
6237095 | Curry et al. | May 2001 | B1 |
6237096 | Bisbee | May 2001 | B1 |
6240413 | Learmont | May 2001 | B1 |
6268850 | Ng | Jul 2001 | B1 |
6324683 | Fuh et al. | Nov 2001 | B1 |
6493804 | Soltis et al. | Dec 2002 | B1 |
6516404 | Arimilli | Feb 2003 | B1 |
6553384 | Frey et al. | Apr 2003 | B1 |
6654760 | Baskins et al. | Nov 2003 | B2 |
6772154 | Daynes et al. | Aug 2004 | B1 |
6778651 | Jost et al. | Aug 2004 | B1 |
6807582 | Muschenborn | Oct 2004 | B1 |
6826757 | Steele, Jr. et al. | Nov 2004 | B2 |
7058954 | Wollrath et al. | Jun 2006 | B1 |
7076784 | Russell et al. | Jul 2006 | B1 |
7103597 | McGoveran | Sep 2006 | B2 |
7149737 | Luo et al. | Dec 2006 | B1 |
7289992 | Walker | Oct 2007 | B2 |
7496574 | Walker | Feb 2009 | B2 |
7506313 | Bates et al. | Mar 2009 | B2 |
8126911 | Hu et al. | Feb 2012 | B2 |
8181065 | Fachan et al. | May 2012 | B2 |
8332374 | Lev et al. | Dec 2012 | B2 |
20030014394 | Fujiwara | Jan 2003 | A1 |
20040054643 | Vemuri et al. | Mar 2004 | A1 |
20040064439 | Hinshaw et al. | Apr 2004 | A1 |
20040068501 | McGoveran | Apr 2004 | A1 |
20040220933 | Walker | Nov 2004 | A1 |
20040221079 | Goldick | Nov 2004 | A1 |
20040230903 | Elza et al. | Nov 2004 | A1 |
20050044092 | Adya et al. | Feb 2005 | A1 |
20050060559 | McKenney | Mar 2005 | A1 |
20050234902 | Meredith et al. | Oct 2005 | A1 |
20060064554 | Fridella et al. | Mar 2006 | A1 |
20060149739 | Myers | Jul 2006 | A1 |
20060167921 | Grebus et al. | Jul 2006 | A1 |
20060271395 | Harris et al. | Nov 2006 | A1 |
20060271396 | Lee et al. | Nov 2006 | A1 |
20070088928 | Thangaraj et al. | Apr 2007 | A1 |
20070143398 | Graham | Jun 2007 | A1 |
20070168292 | Jogand-Coulomb et al. | Jul 2007 | A1 |
20070186056 | Saha et al. | Aug 2007 | A1 |
20070186069 | Moir | Aug 2007 | A1 |
20070233683 | Verma et al. | Oct 2007 | A1 |
20070239915 | Saha et al. | Oct 2007 | A1 |
20080178169 | Grossner et al. | Jul 2008 | A1 |
20080263549 | Walker | Oct 2008 | A1 |
Number | Date | Country |
---|---|---|
2239334 | Jun 1991 | GB |
01-166236 | Jun 1989 | JP |
Entry |
---|
Herlihy, et al., “Software Transactional Memory for Dynamic-Sized Data Structures,” Date: Jul. 13, 2003-Jul. 16, 2003, pp. 1-10. |
Herlihy, et al., “Transactional Memory:Architectural Support for Lock-Free Data Structures”, pp. 1-12. May 1993. |
Shaughnessy, Managed Code Database Advantage for the Microsoft .NET Framework Platform, Date: Sep. 11, 2004-Sep. 15, 2004, http://bdn1.borland.com/borcon2004/article/paper/0,1963,32236,00.html. |
Guerraoui, “Polymorphic Contention Management”, Jan. 1, 2005. |
Iyer, “Scheme to Route Transaction Groups in Multi-System Data Sharing”, May 1, 1987. |
Saha, “Architectural Support for Software Transactional Memory”, 39th Annual IEEE/ACM International Symposium on Microarchitecture. Dec. 1, 2006. |
Banatre, “A Fault Tolerant Tightly Coupled Multiprocessor Architecture based on Stable Transational Memory”, Mar. 1990. |
European Partial Search Report, Ref. EP67734RK900kja, for Application No. 08771364.0-2211 / 2176763 PCT/US2008067343, Nov. 4, 2011. |
PCT International Search Report and Written Opinion for Application No. PCT/US2008/067343, Jan. 19. 2009. |
JP Notice of Rejection for Application No. 2010-514980, Jan. 25, 2013. |
CN Notice on the Third Office Action for Application No. 200880020189.3, Feb. 4, 2013. |
Number | Date | Country | |
---|---|---|---|
20110161603 A1 | Jun 2011 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 11824379 | Jun 2007 | US |
Child | 13043082 | US |