SpinWait.SpinUntil and the Task Parallel Library
Often blocking and checking is combined with some sort of timeout. SpinUntil, a static method on the SpinWait structure, combines blocking, waiting, and timeouts. New in the .NET Framework 4.0, SpinUntil simplifies many different scenarios involving the Task Parallel Library (TPL). Jeffery Juday shares some common recipes employing SpinUntil alongside TPL.





All