Showing 51 - 60 of 227 results for “stephen toub”

Await, SynchronizationContext, and Console Apps: Part 3

In Part 1 and Part 2 of this short series, I demonstrated how you can build a SynchronizationContext and use it run an async method such that all of the continuations in that method will run on serialized on the current thread.  This can be helpful when executing async methods in a console app, or in a unit test framework that doesn&rsquo...


Building Async Coordination Primitives, Part 7: AsyncReaderWriterLock

In my last past, we looked at building an AsyncLock in terms of an AsyncSemaphore.  In this post, we’ll build a more advanced construct, an asynchronous reader/writer lock.An asynchronous reader/writer lock is more complicated than any of the previous coordination primitives we’ve created.  It also involves more policy, ...


Is it ok to use nested Parallel.For loops?

Every now and then, I get this question: “is it ok to use nested Parallel.For loops?” The short answer is “yes.”  As is often the case, the longer answer is, well, longer. Typically when folks ask this question, they’re concerned about one of two things.  First, they’re concerned that each nested loop will assume it “owns ...


Building Async Coordination Primitives, Part 3: AsyncCountdownEvent

In my last two posts, I discussed building AsyncManualResetEvent and AsyncAutoResetEvent coordination primitives.  In this post, I’ll build on that to create a simple AsyncCountdownEvent.A countdown event is an event that will allow waiters to complete after receiving a particular number of signals.  The “countdown&rdquo...