How to Make 2500 HTTP Requests in 2 Seconds with Async & Await
Async Await try-catch hell
C# Async / Await - Make your app more responsive and faster with asynchronous programming
'Stop Using Async Await in .NET to Save Threads' | Code Cop #018
What is the role of Async and Await ?
Unity Async Await - Make Your Game Run Smoother!
Deep .NET: Writing async/await from scratch in C# with Stephen Toub and Scott Hanselman
How to Test Asynchronous Rust Programs with Tokio [TUTORIAL]
Multithreading in Java Explained in 10 Minutes
Think Twice Before Using Async Rust | Prime Reacts
Learn C# async/await for beginners
The Async Await Episode I Promised
Sync vs Async programming✅
🌵 Can Async/Await block the main thread?
C# Tutorial: Asynchronous programming with threads, async and await
How to make C++ run FASTER (with std::async)
C# multithreading 🧶
Next-Level Concurrent Programming In Python With Asyncio
Asynchronous vs Multithreading and Multiprocessing Programming (The Main Difference)
Making async code run faster in C#
AsyncIO, await, and async - Concurrency in Python
Don’t Make This Async JS Mistake
What are ASYNC and AWAIT in C#? Asynchronous Programming Tutorial
Комментарии
Probably do a follow-up to this about ReadWriterLockSlim. In most cases in the real world, you want reads to be concurrent, but block on writes. Another option would be covering a cache strategies for use in threading
dadsoul
There is another thing to consider. İf you accidentally call the Release method from any other thread, semaphore allows it. To ensure that the Release call will be only within the owner thread, Mutex class can be used.
busra.tuncdan
Glad to see you took it down and reuploaded with my feedback implemented! It's important to lead by example, and it's a much better scenario to have a beginner ask "wait why is the Wait happening outside of the try?" and end up learning about this pitfall through inquisitive learning.
Good job Nick. I'm proud to share your videos with my coworkers consistently
AvenDonn
I would say it is really hard to explain smth like that in a very short period of time...but you did it wow.
corso
You missed one important thing, classic lock allows the same thread to re-enter synchronized section, however SemaphorSlim can be entered only specified amount of times. Semaphore slim is not the same lock as lock for sync code
mbenedyk
The algorithm be smoking crack if it thinks I'm gonna understand a word of this
dannydyerschocolatehumuncl
Beautiful, thank you. Always learning something new from you Nick.
sigma_z
THIS... This is why I subscribed to Nick. Always something new and useful. 😎💪
UFOCurrents
You're the man! This is so valuable advice 🥳
ix
Waiting for a more detailed video about this 👍
diego_samano
why haven't you used a full version of youtube for this video? It is not convenient to use "shorts" for education - cannot rewind back, cannot change speed...
mykola
You probably want to use the 2-integer constructor in this scenario, the second parameter being "maxCount": new SemaphoreSlim(1, maxCount: 1);
This prevents extra, erroneous calls to Release() from allowing concurrent access through the critical section. By specifying a max count, these extra calls to Release() will instead fail-fast (via exception).
Example:
var ss = new SemaphoreSlim(1); // SemaphoreSlim(1, 1);
await ss.WaitAsync();
ss.Release();
ss.Release(); // oops! .. now 2 concurrent accessors allowed
ss.Release(); // oops! .. now 3
It's an edge case, and probably TMI for the short video -- just FYI.
patrick_
Its not just a good idea to use finally block, its a must have
dmitrykim
Any concerns with implementing IDisposable in the SemaphoreSlim class to do the release on dispose so it’s a bit cleaner to lock with a using block and avoid a try-finally block? It would also visually highlight what code is locked.
noneofyourbusiness
That's quite good information.. thank you
rohanskoshti
There's a slightly behavior difference though. The lock keyword allows reentrant code to enter the critical region several times in the call stack, while with SemaphoreSlim you'd need some sort of way to tell the current task already is allowed to enter the region without attempting to wait for an exhausted semaphore.
federicoazzato
Suggestion for the future: how about a quick intro to TPL DataFlow? (ActionBlock)
Or is it "outdated" nowdays?
AvenDonn
love this! Tha'ts why I subscribed!
Dpaz
me writing rust: "wait, not being thread safe was even an option?"
theroboman
Re-upload, eh? Still going to point to AsyncLock in the AsyncEx library. ;)