Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

kysect/Mesty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Mesty

Mesty is PoC of tooling that try to calculate all possible states of code that executes by multiple threads.

For example, this code:

public class SampleClass1
{
    private long _setCount;
    private readonly AutoResetEvent _notEmptyEvent = new(false);

    public void Set()
    {
        long newValue;
        newValue = Interlocked.Increment(ref _setCount);
        long tempValue = 1;
        if (newValue == tempValue)
        {
            _notEmptyEvent.Set();
        }
    }
}

can be invoked this way:

for (int i = 0; i < 3; i++)
    Task.Run(() => classInstance.Set());

3 threads will try to execute Increment method and possible results of method class for different methods:

1. 1th - 1; 2th - 2; 3th - 3
2. 1th - 1; 2th - 3; 3th - 2
3. ...

Generating all combinations allow us to proof that code has deadlocks or lead to unexpected results.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages