Conversation
| { | ||
| public async Task FooAsync(Timing head) | ||
| { | ||
| using (new Timing(MiniProfiler.Current, head, "foo async", minSaveMs: 100000)) |
There was a problem hiding this comment.
if i use profiler.Step for this it would make all foo async timing to be a long tree with each timing having one child only, this is because Timing replaced the head with itself, so creating 1000 timings in parallel would make them all children of each other. My test is a bit more artificial than i would have liked - i explicitly pass the correct head to each timing
There was a problem hiding this comment.
Also high minSaveMs is important since it triggers the children to be removed from the parent node, if their timing exceeds minSaveMs or minSaveMs is not set they would not be removed and the issue will not get triggered - this is another artificial piece about this test.
| if (Interlocked.Increment(ref _threadsAccessing) > 1) | ||
| throw new Exception("Concurrent access"); | ||
|
|
||
| Task.Delay(10).Wait(); |
There was a problem hiding this comment.
i think this delay is helping to trigger the concurrency since the timing spend much longer doing RemoveChild
No description provided.