• 0 Posts
  • 82 Comments
Joined 1 year ago
cake
Cake day: July 9th, 2023

help-circle














  • You aren’t slowing down anything. If you didn’t use async that thread would be blocked.

    You’d need a thread per request even though they are sat doing nothing while waiting for responses.

    Instead when you hit an await that thread is freed for other work and when the wait is over the rest of the code is scheduled to run.



  • A huge amount of time in apps is spent waiting for IO, database or web requests to complete.

    Async prevents locking a thread during this wait.

    If you’re handling a large amount of requests in a web server, for example, it allows other requests to progress while waiting for these operations.

    Threads are also expensive to start and manage.

    Also handling threads manually is a pain in the ass.




  • I kept joking with my kids that if they were naughty we’d have squidmas instead.

    I used ChatGPT to create squidmas songs. It managed to perfectly understand the idea and generate squid based Christmas songs that made total sense.

    “All I want for squidmas” was a mistake!

    It seems unlikely this was in its training data.

    There’s a good Asimov story where they’re trying out a new type of brain and they discover it has a subconscious layer that they didn’t explicitly create. It can dream and when it does it doesn’t follow the 3 rules.