Skip to content

Conversation

@alexsku
Copy link
Owner

@alexsku alexsku commented Dec 23, 2016

No description provided.

{
public async Task FooAsync(Timing head)
{
using (new Timing(MiniProfiler.Current, head, "foo async", minSaveMs: 100000))
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this delay is helping to trigger the concurrency since the timing spend much longer doing RemoveChild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants