#ICYMI: While playing with Azure Event Hubs, I decided that I wanted to implement a thread locking mechanism that didn’t queue. That is, I want to try and get a lock on the resource, and if it’s currently in use, just forget it and move on. The default behavior in C# is to wait for the resource. For example, consider my method: static async Task MyProcedure() { Console.WriteLine($“Test1 {DateTime.Now}”); await Task.Delay(5000); Console.WriteLine($“Test2 {DateTime.Now}”); }
I could execute this five times like so: https://goo.gl/gbWsV4 #DataIntegration #ML
Share this:
- Click to share on Facebook (Opens in new window)
- Click to share on Twitter (Opens in new window)
- Click to email a link to a friend (Opens in new window)
- Click to share on LinkedIn (Opens in new window)
- Click to share on Tumblr (Opens in new window)
- Click to share on Pinterest (Opens in new window)
- Click to share on Reddit (Opens in new window)