Claims
- 1. A method for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the method comprising:
at each replica, multicasting control messages that contain mutex ordering information indicating the order in which threads in the replicas claim mutexes; and delivering said control messages using a multicast group communication protocol that delivers the messages in an order that determines the order in which the operating system's thread library grants said claims of mutexes to the threads in the replicas.
- 2. A method as recited in claim 1, further comprising:
employing thread library interpositioning to intercept calls to functions of the operating system's thread library; wherein said interpositioning is provided by a Consistent Multithreading (CMT) library interposed ahead of the operating system's thread library, so that, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said library interpositioning to a function of the CMT library which subsequently invokes the corresponding function of the operating system's thread library.
- 3. A method for replicating a multithreaded application program with an active replication strategy, wherein said multithreaded application program executes under the control of an operating system having a thread library, the method comprising:
employing thread library interpositioning to intercept calls to functions of the operating system's thread library; wherein said interpositioning is provided by a Consistent Multithreading (CMT) library interposed ahead of the operating system's thread library, so that when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said library interpositioning to a function of the CMT library which subsequently invokes the corresponding function of the operating system's thread library.
- 4. A method as recited in claim 3, further comprising:
at each replica, multicasting control messages that contain mutex ordering information specifying the order in which threads in the replicas claim mutexes; and delivering said control messages using a multicast group communication protocol that delivers the messages in an order that determines the order in which the operating system's thread library grants said claims to the threads in the replicas.
- 5. A method for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the method comprising:
at each replica, multicasting control messages that contain mutex ordering information specifying the order in which threads in the replica claim mutexes; delivering said control messages using a multicast group communication protocol that delivers the messages in an order that determines the order in which the operating system's thread library grants said claims to the threads in the replicas; and employing thread library interpositioning to intercept calls to functions of the operating system's thread library; wherein said interpositioning is provided by a Consistent Multithreading (CMT) library that is interposed ahead of the operating system's thread library, so that when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said library interpositioning to a function of the CMT library which subsequently invokes the function of said operating system's thread library.
- 6. A method for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the method comprising:
providing a Consistent Multithreading (CMT) library that is interposed ahead of the operating system's thread library.
- 7. A method as recited in claim 6, wherein said CMT library contains wrapper functions for functions of the operating system's thread library.
- 8. A method as recited in claim 7, wherein in response to a replica of said replicated multithreaded application program invoking a function to claim or release a mutex, said invocation is diverted by library interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 9. A method as recited in claim 8, wherein said CMT library function multicasts a message to all of the replicas of a process, object or component and subsequently invokes the corresponding function of the operating system's thread library.
- 10. A method as recited in claim 9, wherein said message is multicast using a reliable ordered multicast group communication protocol.
- 11. A method as recited in claim 10:wherein said multicast protocol delivers messages reliably and in the same order to all of the replicas; wherein the mutexes are granted in the same order to the threads in all of the replicas.
- 12. A method as recited in claim 9, wherein if two different threads both request a particular claim for a mutex, the message containing that claim that is ordered and delivered by the multicast protocol first, determines the order in which the operating system's thread library grants said claims to the threads in the replicas first.
- 13. A method as recited in claim 6:wherein if the application program runs on an operating system that supports Dynamically Linked Libraries (DLL), the DLL mechanisms are used to interpose the CMT library ahead of the operating system's thread library; wherein, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, the invocation is diverted by said DLL mechanisms to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 14. A method as recited in claim 6, further comprising:
adding a statement to the makefile for said application program that causes the linker to interpose the CMT library ahead of the operating system's thread library if the operating system does not provide Dynamically Linked Libraries; wherein, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by library interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 15. A method for achieving strong replica consistency for replicated multithreaded application programs that use an active replication strategy, comprising:
sanitizing replicated multithreaded application programs by masking multithreading as a source of non-determinism.
- 16. A method for replicating a multithreaded application program using an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the method comprising:
providing a Consistent Multithreading (CMT) library that is interposed ahead of the operating system's thread library; wherein said CMT library contains wrapper functions for functions of the operating system's thread library; wherein, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a wrapper function of the CMT library which subsequently invokes the function of the operating system's thread library.
- 17. A method as recited in claim 16, wherein when a replica invokes a function of the CMT library to claim a mutex, the CMT library function multicasts a message containing that claim to all of the replicas of the process, object or component and subsequently invokes the corresponding function of the operating system's thread library.
- 18. A method as recited in claim 17:wherein said message is multicast using a reliable ordered multicast group communication protocol; wherein said multicast protocol delivers messages reliably and in the same order to all of the replicas of the process, object or component.
- 19. A method as recited in claim 18, wherein the mutexes are granted in the same order to the threads in all of the replicas of the process, object or component.
- 20. A method as recited in claim 19, wherein if two different threads both issue a particular claim for a mutex, the message containing said claim that the multicast protocol orders and delivers first determines which claim the operating system's thread library grants first.
- 21. A method as recited in claim 16:wherein if the application program runs on an operating system that provides Dynamically Linked Libraries (DLL), the DLL mechanisms are used to interpose the CMT library ahead of the operating system's thread library; wherein, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 22. A method as recited in claim 16, further comprising:
adding a statement to the makefile for said application program that causes the linker to interpose the CMT library ahead of the operating system's thread library if the operating system does not provide Dynamically Linked Libraries; wherein, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 23. A method for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system, said method comprising:
allowing threads to communicate with each other by multicasting messages; and allowing threads to use a shared resource.
- 24. A method as recited in claim 23, wherein said shared resource comprises shared data.
- 25. A method as recited in claim 23, further comprising:
using a mutex to protect said shared resource accessed by threads in the replicas of said replicated multithreaded application program; wherein said threads in all replicas of the multithreaded application program access the shared resource in the same order.
- 26. A method as recited in claim 25, further comprising:
intercepting calls to the operating system's thread library at each replica; and multicasting, to the replicas, ordering information regarding the order in which threads in the replicas claim mutexes.
- 27. A method as recited in claim 26, wherein multicast messages that contain ordering information regarding the order in which threads claim mutexes are delivered reliably and in the same order to all of the replicas of a process, object or component.
- 28. A method as recited in claim 27, wherein if multicast messages from two different replicas contain ordering information such that each of two different threads in said replicas claim the same mutex, then the message that is ordered and delivered first determines which thread in the replicas is granted its claim to the mutex first.
- 29. A method as recited in claim 28, further comprising:
maintaining strong replica consistency and application transparency by interpositioning a multithreading library ahead of the operating system's thread library and intercepting calls to functions of said operating system's thread library, so as to render the application program virtually deterministic.
- 30. A method as recited in claim 29:wherein functions of the operating system's thread library are wrapped by functions of the multithreading library; wherein the wrapper functions invoke the corresponding functions of the operating system's thread library.
- 31. A method as recited in claim 30, wherein said wrapping is performed by functions of a multithreading library that is dynamically linked to said application program.
- 32. A method as recited in claim 30, further comprising:
providing a mechanism at a replica that can decide not to multicast information, related to a thread of that replica claiming a mutex, if the replica has already received a message that contains information related to the same thread in another replica issuing the same claim for that mutex.
- 33. A method as recited in claim 32, wherein if a replica receives a message containing information related to a thread in that replica claiming a mutex, and if the replica has already received a message that contains information related to the corresponding thread in another replica issuing the same claim for the mutex, the replica ignores the information contained in the later received message.
- 34. A method as recited in claim 33, further comprising:
allowing concurrent processing of threads that do not attempt to use the same shared resource simultaneously; and allowing concurrent processing of threads that claim different mutexes; wherein strong replica consistency is maintained.
- 35. A software mechanism for replicating a multithreaded application program using an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the mechanism comprising:
control program code; said control program code configured, at each replica, to multicast control messages that contain mutex ordering information indicating the order in which threads in the replica claim mutexes; said control program code delivering said control messages using a multicast group communication protocol that delivers the messages in an order that determines which claim the operating system's thread library grants first.
- 36. A software mechanism as recited in claim 35:wherein a multithreading library containing said control program code is interpositioned ahead of the operating system thread's library; and wherein when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the multithreading library which subsequently invokes a function of the operating system's thread library.
- 37. A software mechanism for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the mechanism comprising:
a consistent multithreading thread library interpositioned ahead of the operating system's thread library so that when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of a Consistent Multithreading (CMT) library which subsequently invokes a function of the operating system's thread library.
- 38. A software mechanism as recited in claim 37, further comprising:
control program code associated with said consistent multithreading thread library; said control program code configured, at each replica, to multicast control messages that contain mutex ordering information that indicates the order in which threads in the replica claim mutexes; said control program code configured to deliver said control messages using a multicast group communication protocol that orders and delivers messages in an order that determines which claim the operating system's thread library grants first.
- 39. A software mechanism for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the mechanism comprising:
control program code; said control program code configured, at each replica, to multicast control messages that contain mutex ordering information that indicates the order in which threads in the replica claim mutexes; said control program code configured to deliver said control messages using a multicast group communication protocol that orders and delivers the messages in an order that determines which claim the operating system's thread library grants first; and a consistent multithreading library interpositioned ahead of the operating system's thread library to intercept calls to functions of the operating system's thread library.
- 40. A software mechanism for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the mechanism comprising:
a Consistent Multithreading (CMT) library that is interposed ahead of the operating system's thread library; wherein said Consistent Multithreading (CMT) library contains wrapper functions for functions of the operating system's thread library.
- 41. A software mechanism as recited in claim 40, wherein, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 42. A software mechanism as recited in claim 41, wherein when a replica of a replicated multithreaded application program claims a mutex, the CMT library function, while processing said claim, multicasts a message to all of the replicas of a process, object or component and subsequently invokes the corresponding function of the operating system's thread library.
- 43. A software mechanism as recited in claim 42:wherein said message is multicast using a reliable ordered multicast group communication protocol; wherein said multicast protocol delivers messages reliably and in the same order to all of the replicas.
- 44. A software mechanism as recited in claim 43, wherein the mutexes are granted in the same order to the threads in all of the replicas.
- 45. A software mechanism as recited in claim 44, wherein if two different threads in the replicas both issue a particular claim for a mutex, the message containing said claim that the multicast protocol orders and delivers first determines which claim the operating system's thread library grants first.
- 46. A software mechanism as recited in claim 39:wherein if the application program runs on an operating system that provides Dynamically Linked Libraries (DLL), the dynamic linking mechanisms are used to interpose the Consistent Multithreading (CMT) library ahead of the operating system's thread library; and wherein when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 47. A software mechanism as recited in claim 39, further comprising:
adding a statement to the makefile for said application program that causes the linker to interpose the CMT library ahead of the operating system's thread library if the operating system does not provide Dynamically Linked Libraries; and wherein, when said replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 48. A software mechanism for achieving strong replica consistency for replicated multithreaded application programs using an active replication strategy, comprising:
control program code configured to sanitize multithreaded application programs by masking multithreading as a source of non-determinism to ensure that two or more replicas of a process, object or component maintain the same state.
- 49. A software mechanism for replicating a multithreaded application program based on an active replication strategy, wherein said application program executes under the control of an operating system having a thread library, the mechanism comprising:
a Consistent Multithreading (CMT) library that is interposed ahead of the operating system's thread library; wherein said Consistent Multithreading (CMT) library contains wrapper functions for functions of the operating system's thread library; wherein when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a wrapper function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 50. A software mechanism as recited in claim 49, wherein when a replica invokes a function of the Consistent Multithreading (CMT) library to claim a mutex, the Consistent Multithreading (CMT) library function multicasts a message, containing mutex ordering information for that claim, to all of the replicas of the process, object or component and subsequently invokes the corresponding function of the operating system's thread library.
- 51. A software mechanism as recited in claim 50:wherein said message is multicast using a reliable ordered multicast group communication protocol; wherein said multicast protocol delivers messages reliably and in the same order to all of the replicas.
- 52. A software mechanism as recited in claim 51:wherein the mutexes are granted in the same order to the threads in all of the replicas.
- 53. A software mechanism as recited in claim 50, wherein if two different threads each issue a particular claim for a mutex which is multicast in a message, the message containing the claim that the multicast protocol orders and delivers first determines which claim the operating system's thread library grants first.
- 54. A software mechanism as recited in claim 49:wherein if the application program runs on an operating system that provides Dynamically Linked Libraries (DLL), the dynamic linking mechanisms are used to interpose the Consistent Multithreading (CMT) library ahead of the operating system's thread library; and wherein when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 55. A software mechanism as recited in claim 49, further comprising:
adding a statement to the makefile for said application program that causes the linker to interpose the CMT library ahead of the operating system's thread library if the operating system does not provide Dynamically Linked Libraries; and wherein when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a function of the CMT library which subsequently invokes a function of the operating system's thread library.
- 56. A software mechanism for replicating a multithreaded application program with an active replication strategy, wherein said application program executes under the control of an operating system, said mechanism comprising:
control program code; said control program code configured to use a multicast group communication protocol to render a replicated multithreaded application program virtually deterministic.
- 57. A software mechanism as recited in claim 56:wherein said control program code is configured to use mutexes to protect shared resources, accessed by threads in the replicas of said replicated multithreaded application program; wherein said threads are granted the mutexes to access the shared resource in the same order at all of the replicas of said replicated multithreaded application program.
- 58. A software mechanism as recited in claim 57, wherein said shared resources comprise shared data.
- 59. A software mechanism as recited in claim 57:wherein said control program code is configured to intercept calls to the functions of the operating system thread library at each replica; wherein said control program code is configured to multicast, to the replicas, ordering information regarding the order in which the threads in the replicas claim mutexes.
- 60. A software mechanism as recited in claim 59, wherein multicast messages that contain ordering information regarding the order in which threads claim mutexes are delivered reliably and in the same order to all of the replicas.
- 61. A software mechanism as recited in claim 60, wherein if multicast messages from different replicas contain ordering information so that each of two different threads in two different replicas claim the same mutex, then the message that the multicast protocol orders and delivers first determines which claim the operating system's thread library grants first.
- 62. A software mechanism as recited in claim 61, wherein strong replica consistency and application transparency are maintained by interpositioning a consistent multithreading library ahead of the operating system's thread library and intercepting calls to functions of said operating system's thread library, so as to render the replicated application program virtually deterministic.
- 63. A software mechanism as recited in claim 62, wherein functions of the operating system's thread library are wrapped by functions of the consistent multithreading library, and wherein, when a replica of said replicated multithreaded application program invokes a function to claim or release a mutex, said invocation is diverted by said interpositioning to a wrapper function of the CMT library which subsequently invokes the corresponding function of the operating system's thread library.
- 64. A software mechanism as recited in claim 63, wherein a replica can decide not to multicast information related to the claim of a mutex by a thread in the replica if the replica has already received a message that contains information relating to the same claim of the mutex by the corresponding thread in another replica.
- 65. A software mechanism as recited in claim 64, wherein if a replica receives a message containing information related to the claim of a mutex by a thread in a replica, and if the replica has already received a message that contains information related to the same claim of the mutex by the corresponding thread in another replica, the replica ignores the information contained in the later received message.
- 66. A software mechanism as recited in claim 65:wherein said control program code is configured to allow concurrent processing of threads that do not attempt to claim the same mutex and concurrent processing of threads that claim different mutexes; wherein strong replica consistency is maintained.
- 67. A system for executing threads in replicas of an application program within a computing environment, using the active replication strategy, in which resources are shared between threads in a replica, wherein said shared resources comprise either data or code sections for manipulating said data, comprising:
means for communicating to multiple replicas the claims of shared resources by threads in a replica; and means for ordering shared resource claims to be granted to threads in multiple replicas corresponding to the order in which claims for the resources were communicated, ordered and delivered through said means for communicating the order of claiming.
- 68. A system as recited in claim 67, wherein said means for ordering resource claims is configured to prevent threads from being granted a shared resource until claim information has been communicated to the replicas by at least one of said replicas.
- 69. A system as recited in claim 68, wherein each said replica is configured to order shared resource claims in response to the order of arrival of said shared resource claim information communicated to said replicas.
- 70. A system as recited in claim 69, wherein said shared resource claim information is communicated by multicasting a message to said replicas.
- 71. A system as recited in claim 70, wherein shared resource claim granting is configured to maintain an identical claim granting order across said replicas.
- 72. A system as recited in claim 67, wherein said means for communicating to multiple replicas comprises a means for simultaneously communicating shared resource claim information from a thread in a given replica to all of the replicas.
- 73. A system as recited in claim 72, wherein said means for simultaneously communicating shared resource claims comprises the multicasting of messages to said replicas.
- 74. A system as recited in claim 73, wherein said multicast messages contain information about which shared resource is being claimed, which thread is claiming the given shared resource, and which shared resource claim request of said thread is being made.
- 75. A system as recited in claim 74, wherein said information of which shared resource claim request of said thread is being made comprises a shared resource claim number.
- 76. A system as recited in claim 67, wherein said means for ordering shared resource claims comprises a routine for selectively granting a resource request, with a particular resource claim number, based on the order in which that resource request was communicated, ordered and delivered to the replicas.
- 77. A system as recited in claim 67, wherein said means of ordering shared resource claims controls access to a mutual exclusion construct (mutex) through which access to said shared resource is controlled.
- 78. A system as recited in claim 77, wherein access to said shared resource is controlled by multicasting a message to said replicas.
- 79. A system as recited in claim 78, wherein said message being multicast comprises elements that identify a shared resource, a thread wanting to access said shared resource, and the thread's resource claim number.
- 80. A system as recited in claim 67:wherein said means for communicating and said means of ordering are configured to transparently execute within said system; wherein said transparent execution is provided in application replicas without modifying the application code.
- 81. A system as recited in claim 80, wherein said transparent execution comprises executing functions of a consistent multithreading library for said replicas that do not require the application program code to be modified to perform said means for communicating, and said means for ordering.
- 82. A system as recited in claim 67, further comprising means for communicating pending claims for shared resources to the replicas.
- 83. A system as recited in claim 82, wherein said means for communicating pending claims for shared resources comprises multicasting a message to all of the replicas.
- 84. A system as recited in claim 83, wherein said message comprises information about the order in which the threads claim said shared resource.
- 85. A system as recited in claim 67, wherein said means for ordering shared resource claims in which each corresponding shared resource in a replica maintains identical ordering of corresponding accesses to that shared resource for the corresponding threads in that replica.
- 86. A system as recited in claim 85, wherein said resource claim information for a particular thread is recorded in an ordered claims queue in the order in which said claims are to be fulfilled.
- 87. A system as recited in claim 67, wherein said means for communicating, and said means for ordering, are configured as a set of functions of a consistent multithreading library that are executed in response to selected calls to functions of the operating system's thread library.
- 88. A system as recited in claim 87, wherein said set of functions are configured to intercept calls to select functions within the operating system's thread library.
- 89. A system as recited in claim 88, wherein said set of functions are dynamically linked into the replicas of said program.
- 90. A system as recited in claim 89, wherein said set of functions are configured for claiming or releasing a shared resource in a virtually deterministic manner in which identical threads in separate replicas are granted resource access in an identical order.
- 91. A system as recited in claim 89, wherein said functions of the consistent multithreading library are configured to maintain replica consistency without the need to modify object code, impose single threaded execution, impose distinctions such as Primary and Backup on the replicas, or count instruction execution between non-deterministic events.
- 92. A system as recited in claim 87, wherein a thread within a replica is suspended upon claiming a shared resource until said claim is communicated to all of said replicas.
- 93. A system as recited in claim 92, wherein said thread suspension is suppressed if said shared resource claim has already been communicated to all of the replicas.
- 94. A system as recited in claim 87, wherein said functions of said consistent multithreading library, including said means for communicating, and said means for ordering are configured to maintain strong replica consistency, by forcing virtually deterministic execution.
- 95. A system as recited in claim 94, wherein the threads in said replicas are forced to access the resources that they share in an identical order.
- 96. A system as recited in claim 94, wherein said strong replica consistency is maintained within client-server systems.
- 97. A system as recited in claim 94, wherein said strong replica consistency is maintained within fault-tolerant systems.
- 98. A system as recited in claim 94, wherein for said replicas strong replica consistency is maintained without distinguishing replicas into roles as either Primary or Backup replicas.
- 99. A system as recited in claim 94, wherein said strong replica consistency is maintained without the need to provide special hardware.
- 100. A system as recited in claim 94, wherein said strong replica consistency is maintained without the need to perform hardware or software instruction counting between non-deterministic events.
- 101. A system as recited in claim 94, wherein said strong replica consistency is maintained without modifying either the application source code or the application object code.
- 102. A system as recited in claim 87, wherein said shared resource comprises memory or an input/output location accessible to the threads of said replica.
- 103. A system as recited in claim 87, wherein said means for communicating is configured to communicate messages containing shared resource claim information.
- 104. A system for executing threads in replicas within a computing environment adapted for executing program replicas, based on an active replication strategy comprising:
an allocation routine configured for granting access to shared resources to threads in said replica, in response to information delivered about the order in which threads in said and other replicas claim access to shared resources; and means for communicating the order in which threads in said replica claim access to shared resources, to all of the replicas within said system.
- 105. A system as recited in claim 104, wherein said means for communicating the order of accessing shared resources comprises a routine configured for multicasting messages to multiple replicas in response to access requests and selected state changes.
- 106. A consistent multithreading library of thread functions for constraining access to shared resources by threads in a replica within a computing environment configured for executing multiple program replicas, based on the active replication strategy, comprising functions that invoke:
a communication routine configured for communicating allocation information about said shared resources to multiple replicas within said computing environment; and an allocation routine configured for allocating shared resources to threads in a replica in response to information delivered, related to the order in which said shared resources were claimed by the threads in the replicas.
- 107. A library as recited in claim 106:wherein said library of thread functions wrap functions of the operating system's thread library; wherein said library is interposed ahead of the operating system's thread library.
- 108. A library as recited in claim 107:wherein said wrapper functions include programming configured for carrying out the operations of
invoking communication and allocation routines, and invoking functions of said operating system's thread library.
- 109. A library as recited in claim 107, wherein said interception of calls to the operating system's thread library is performed by a dynamic linking process.
- 110. A library as recited in claim 109, wherein said interception of calls to the operating system's thread library is performed by inserting commands in the makefile for said program, to cause the linker to position said library of thread functions ahead of the operating system's thread library.
- 111. A library as recited in claim 109, wherein said library of thread functions are configured as a set of functions incorporated within the operating system's thread library.
- 112. An apparatus for executing threads in replicas within a computing environment, using the active replication strategy, while maintaining strong replica consistency across said replicas, comprising:
a computer configured for executing said replicas; and programming associated with said computer for carrying out the operations of
communicating to multiple replicas the order of requests for access to shared resources by threads in a replica, and ordering the granting of resource access requests by the threads in a replica in response to the order in which said resource access requests are ordered and delivered.
- 113. A media that is computer readable and includes a computer program which, when executed on a computer configured for multithreaded execution and communication with multiple program replicas, causes the computer to execute instructions, comprising:
communicating to multiple replicas the order of claiming of shared resources by threads in a replica; and ordering the granting of resource claims to corresponding threads in multiple replicas in response to the order in which the claims of said threads for access to the shared resources are ordered and delivered to the multiple replicas.
- 114. A system executing a multithreaded application program within a computing environment in which said program is replicated using the active replication strategy, comprising:
a consistent multithreading library having functions configured for suspending a thread that claims a shared resource; a multicast group communication protocol for communicating the order of the claims of the shared resources by the threads in the replicas; and resource granting functions configured for granting access to shared resources, and activating suspended threads, in response to said ordering of shared resource claims when said resources are available.
- 115. A system as recited in claim 114, wherein a resource identifier, thread identifier, and claim identifier, are communicated by said multicast group communication protocol.
- 116. A system as recited in claim 114, wherein said replicated multithreaded program is rendered virtually deterministic in order to maintain strong replica consistency.
- 117. A system as recited in claim 114, wherein said resource granting functions are executed in conjunction with a consistent multithreading library for controlling access to shared resources.
- 118. A system as recited in claim 117:wherein said functions of said consistent multithreading library intercept calls to functions of the operating system's thread library, wherein strong replica consistency is maintained while said functions of the consistent multithreading library remain transparent to said application program.
- 119. A system as recited in claim 114, wherein the order in which said multicast protocol delivers messages containing a claim by a given thread for access to a given shared resource for a given claim number, determines the order in which the claims to the shared resource are granted to said threads in said replicas within said computing environment.
- 120. A system as recited in claim 114, wherein said thread suspension, multicast group communication of claim order, and resource granting functions are invoked by functions of the consistent multithreading library that intercept the functions for claiming and releasing resources provided by the operating system's thread library.
- 121. A system as recited in claim 114, wherein multicasting of a claim request can be suppressed if a given replica has already received the same claim for the same shared resource by the same thread.
- 122. A system as recited in claim 114, wherein threads that are not currently claiming the same shared resources are allowed to process concurrently.
- 123. A system as recited in claim 114, wherein said communication comprises the multicasting of messages containing information, or the writing into shared memory of information, related to the claiming of shared resources.
- 124. A system for replicating multithreaded application programs on computers within a computing environment, using the active replication strategy, comprising:
a consistent multithreading library configured for linking with said application program and processing shared resource access requests; and a means for maintaining an identical order of shared resource access by threads within replicas, thereby providing virtual determinism and strong replica consistency.
- 125. A system as recited in claim 124, wherein said computers that host said replicas of said application programs may provide multithreading, multitasking, distributed computing, fault tolerance, a client-server paradigm, and combinations thereof.
- 126. A system as recited in claim 124, wherein said means for maintaining an identical order of resource access comprises functions of a consistent multithreading library that are executed in response to shared resource access requests and associated operations.
- 127. A system as recited in claim 126, wherein said functions of said consistent multithreading library are configured as wrapper functions of the functions of the operating system's thread library.
- 128. A system as recited in claim 126, wherein said wrapper functions of consistent multithreading library intercept calls to the operating system's thread library and execute preceding the execution of functions of the operating system's thread library.
- 129. A system as recited in claim 128, wherein said consistent multithreading library is configured for being dynamically linked into said application programs.
- 130. A system as recited in claim 127, wherein said functions of said consistent multithreading library are configured to:
communicate shared resource claim information to all of the replicas; order resource claim information in each replica in response to the order in which shared resource claims are delivered; and grant shared resource claims in each replica in response to said order, wherein the corresponding threads of the replicas access corresponding shared resources in an identical order.
- 131. A system as recited in claim 130, wherein said library is configured for maintaining pending claims and ordered claims queues that record the order in which mutexes are claimed, granted and released.
- 132. A system as recited in claim 124, wherein said means for maintaining an identical order of resource access comprises:
multicasting a message identifying resource claims; and granting claims for resources in response to the order in which messages identifying resource claims are delivered.
- 133. A system as recited in claim 132, wherein said message contains information that identifies the shared resource for which a claim is being made, the thread that is claiming the resource, and the thread's resource claim number.
- 134. A system as recited in claim 133:wherein said granting of claims, in response to the order in which messages containing resource claims are delivered, causes the suspension of threads claiming a shared resource, until said resource is available and any prior claims for that resource have been granted; wherein a prior claim for a resource, relative to a specific claim, is a claim contained in a message that is ordered and delivered ahead of the first message that contained said specific claim.
- 135. A method of maintaining virtually deterministic behavior among multiple replicas of a replicated multithreaded application program where corresponding threads in the replicas access corresponding shared resources, comprising:
communicating requests for access to shared resources to all of the replicas of said application program; and granting access requests for shared resources to threads in said replicas in response to the order in which requests for access to said shared resources are delivered to the replicas.
- 136. A method as recited in claim 135, wherein the order in which a thread in a replica of said application program accesses a shared resource is identical across all of the replicas to provide virtually deterministic behavior.
- 137. A method as recited in claim 135, wherein said granting of access requests for shared resources comprise functions of a consistent multithreading library.
- 138. A method as recited in claim 137, wherein said consistent multithreading library is interposed ahead of the operating system's thread library and where the functions of said consistent multithreading library wrap the corresponding functions of the operating system's thread library.
- 139. A method as recited in claim 138, wherein said consistent multithreading library is interposed ahead of the operating system's thread library by dynamic or static linking.
- 140. A method as recited in claim 139, wherein a claim for a resource by a thread that was ordered and delivered determines the access order for the corresponding shared resources by corresponding threads in all of the replicas.
- 141. A method as recited in claim 140, wherein said thread is suspended after claiming a resource until said request has been communicated, ordered and delivered.
- 142. A method of executing actively replicated multithreaded application programs containing threads that access shared resources, comprising:
invoking a claim for a shared resource by a thread; multicasting a message to communicate said shared resource claim to all of the replicas of said application program; ordering of shared resource claim requests; and granting said shared resource to a given thread in response to the order in which multicast messages are communicated, ordered and delivered, and to the availability of said shared resource.
- 143. A method as recited in claim 142, further comprising releasing said shared resource by said thread allowing other threads to access said shared resource.
- 144. A method as recited in claim 142, further comprising suspending said thread making said shared resource claim until after said claim information has been communicated, ordered and delivered to the replicas.
- 145. A method as recited in claim 142, wherein said multicast message contains information regarding the shared resource being claimed, the thread claiming the shared resource, and the thread's claim request number.
- 146. A method as recited in claim 145, wherein said information about claim requests is recorded in a pending claims queue.
- 147. A method of identically ordering accesses to corresponding shared resources by corresponding threads in different replicas of an actively replicated multithreaded application program, comprising:
invoking a claim on a shared resource by a thread in a replica in preparation for accessing said shared resource; suspending execution of said thread invoking said resource claim; multicasting a message to communicate information about said resource claim by said thread in said replica to all of the replicas; ordering and delivering said information about said resource claims by said multicast; granting access to said resource, when available, to a thread in response to the order in which said information is delivered to the replicas; and releasing said resource, by said thread granted said resource, after said thread has completed accessing said shared resource.
- 148. A method as recited in claim 147, wherein access to said shared resource is controlled by a mutual exclusion construct (mutex), to which a claim by a given thread must be granted prior to that thread accessing said shared resource associated with said mutual exclusion construct.
- 149. A method as recited in claim 148, wherein information about said shared resource claims is recorded in pending claims and ordered claims queues.
- 150. A method as recited in claim 148, wherein said claim to a mutual exclusion construct comprises:
determining (T, M, N) for a claim to a mutual exclusion construct associated with said shared resource, wherein T represents the thread making said claim, M represents the mutual exclusion construct being claimed, and N represents the claim number by thread T to any mutex; determining if (T, N) is the next thread and claim number for which access to the mutual exclusion construct M is to be granted, and if so,
(i) recording that thread T has been granted its Nth claim, (ii) marking said mutual exclusion construct as unavailable, (iii) granting said mutual exclusion construct to thread T, and (iv) bypassing following steps (c) through (e); determining that a claim (T, N) has not been delivered, in which case information about the claim is multicast to other replicas; marking thread T claiming mutual exclusion construct M as suspended; and suspending thread T.
- 151. A method as recited in claim 150, wherein said resource releasing comprises:
marking the mutual exclusion construct associated with said resource as available; selecting the next ordered and delivered but ungranted claim (T′, N′) for the mutual exclusion construct, wherein T′ represents the thread making said resource claim and N′ represents the claim number by thread T′; and signaling thread T′ to awaken thread T′, if thread T′ is suspended.
- 152. A method as recited in claim 147, wherein said method of identically ordering accesses to shared resources by threads in replicas comprises a consistent multithreading library containing functions that control access to shared resources.
- 153. A method as recited in claim 152, wherein said consistent multithreading library is interposed ahead of the operating system's thread library and where the functions of the consistent multithreading library wrap the corresponding functions of the operating system's thread library.
- 154. A method as recited in claim 153, wherein said consistent multithreading library is interposed ahead of the operating system's thread library by dynamic or static linking.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority from U.S. provisional application serial No. 60/367,615 filed on Mar. 25, 2002, incorporated herein by reference, and from U.S. provisional application serial No. 60/367,616 filed on Mar. 25, 2002, incorporated herein by reference.
STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT
[0002] This invention was made with Government support under Grant No. 70NANBOH3015, awarded by the U.S. Department of Commerce, National Institute of Standards and Technology. The Government may have certain rights in this invention.
Provisional Applications (2)
|
Number |
Date |
Country |
|
60367615 |
Mar 2002 |
US |
|
60367616 |
Mar 2002 |
US |