how to prove concurrent algorithms are correct
2010-09-11 19:18
260 查看
"An ounce of prevention equals a pound of cure"
预防为主,治疗为辅。
concurrent abstraction
programs are the execution of atomic statements
concurrent programs are interleavings of atomic statements from two or more threads
All possible interleavings of atomic statements must be shown to retain whatever property we are hoping to verify within a concurrent algorithm.
No thread's statements may be (unfairly) excluded from any arbitrary interleaving
we must show that the desirable property holds for all interleavings of atomic statements from two or more threads.
以互斥区的实现为例,需要hold的properties有以下两点:
1.The code enforces mutual exclusion. Threads are disallowed from entering the critical region when another thread is occupying the critical region. Plus, if there are multiple concurrent requests to enter the critical region and no other thread is currently executing within the region, only one requesting thread must be allowed to enter the critical region.
2.If a thread is not executing within the critical region, that thread cannot prevent another thread seeking entry from entering the region.
预防为主,治疗为辅。
concurrent abstraction
programs are the execution of atomic statements
concurrent programs are interleavings of atomic statements from two or more threads
All possible interleavings of atomic statements must be shown to retain whatever property we are hoping to verify within a concurrent algorithm.
No thread's statements may be (unfairly) excluded from any arbitrary interleaving
we must show that the desirable property holds for all interleavings of atomic statements from two or more threads.
以互斥区的实现为例,需要hold的properties有以下两点:
1.The code enforces mutual exclusion. Threads are disallowed from entering the critical region when another thread is occupying the critical region. Plus, if there are multiple concurrent requests to enter the critical region and no other thread is currently executing within the region, only one requesting thread must be allowed to enter the critical region.
2.If a thread is not executing within the critical region, that thread cannot prevent another thread seeking entry from entering the region.
相关文章推荐
- error C4996: Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct
- How to check whether two rectangle are overlapping
- How to express that you are unhappy.
- How to Create a Java Concurrent Program
- How to know 2 strings are anagram
- How to determine which version of .net framework are installed
- How to share text to Message in the app you are building(iOS platform)
- (转)How To Kill runaway processes After Terminating Concurrent Request
- How to avoid Excel from prompting "The file you are trying to open, , is in a different format than specified by the file extension"? (转)
- How to choose Approximate Nearest Neighbors Searching Algorithms?
- Due to "No space left on device", Many Concurrent Manager are under 'No Manager' Status
- How to work out how many of the parse count are hard/soft? [ID 34433.1]
- How can I force WebLogic to use third party jars that are included in my Ear?
- How to use Trusted Connection when SQL server and web Server are on two separate machines.
- How to Build Distributed Concurrent System(思维草稿)
- How are Receiving Transaction Tied to Inventory Transactions?
- HOWTO disable screensaver and powermanager while mplayer or other apps are running
- How are neural networks related to Fourier transforms
- how to change Exchange OWA concurrent connection
- How to Create Transportable Tablespaces Where the Source and Destination are ASM-Based