Tom Edwards

Results 106 comments of Tom Edwards

I don't think so. It's still a nasty bug that can strike at any time.

This API behaves differently from from Microsoft's. In WPF you cannot use this method to switch execution to the dispatcher thread. It's static and always targets the current thread's dispatcher,...

Now that I start to think about it, creating an awaiter that resumes on an unrelated sync context is IMO an abuse of the async/await pattern. The design intent of...

If the design is to yield to the "current dispatcher", then the method can be static, just like WPF's. The dispatcher is associated with the current thread so a static...

I can reduce the allocations. Not sure how to avoid the array though. We could create an [arena](https://stackoverflow.com/a/12825221) which allocates a large array and then hands out spans within it,...

Unfortunately neither of these will help much in this case. `SafeEnumerableList` will generate a copy of the collection for each enumeration, which we don't want. `PooledList` is better as it...

`AsSpan` won't work. Lists just don't work that way. [The method's documentation carries this warning:](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.collectionsmarshal.asspan?view=net-7.0) > Items should not be added or removed from the List while the Span is...

I added the Arena class that I was talking about in an earlier comment, what are people's thoughts on that?

It shouldn't be considered invalid behaviour, because detaching a control can have user-defined side effects. [See my earlier comment:](#issuecomment-1796052437) > There is no root cause, because user code could be...