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

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FrediKats committed Mar 1, 2024
1 parent 2b20046 commit eb2fec2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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:

```csharp
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:

```csharp
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.

0 comments on commit eb2fec2

Please sign in to comment.