Peeking into assembly code to understand why count++ is not atomic

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ม.ค. 2025

ความคิดเห็น •

  • @piyushpathak1186
    @piyushpathak1186 ปีที่แล้ว +41

    I pay my internet bill for this type of content

  • @Sanjay-pu4sp
    @Sanjay-pu4sp ปีที่แล้ว +5

    You have a real gift for teaching mate. Thanks so much!

  • @adrishray9179
    @adrishray9179 ปีที่แล้ว +1

    Very nicely explained. Love it when when ppl use pens and drawings to teach. The internet needs this type of content

  • @prateekraj1084
    @prateekraj1084 ปีที่แล้ว

    Awesome explanation of such a building block concept.

  • @divyachauhan3478
    @divyachauhan3478 ปีที่แล้ว +1

    I learned this coming from non cse background. So amazing content

  • @viktoreidrien7110
    @viktoreidrien7110 ปีที่แล้ว +1

    Superb video, thanks.

  • @shishirchaurasiya7374
    @shishirchaurasiya7374 ปีที่แล้ว

    I am watching the series the second time, and I can't explain how much clarity in my brain these concepts are getting injected, amazing arpit sir ❤

  • @princekha4540
    @princekha4540 ปีที่แล้ว

    Thanks for the video, bro 🙌

  • @yogeshedekar6078
    @yogeshedekar6078 ปีที่แล้ว

    This reminded me of my Microprocessor practiclas where we would code using JMP for loops on a set of keyboard and small monitor. Amazing though, hard to find such deapth for any of the concurrency lectures.

  • @rahulsangvikar7973
    @rahulsangvikar7973 7 หลายเดือนก่อน +1

    Why do we need 2 mov micro instructions? Why couldn't we just use something like
    addl $1, %rdi
    as a single micro instruction?
    Also, adding just 1 to a number "binarily" is extremely efficient right? It's much faster than adding any other number, so why couldn't we handle this as a special case?

  • @MOHDSALMAN-sj2zu
    @MOHDSALMAN-sj2zu ปีที่แล้ว

    Hi Arpit,
    Thank you for this explanation. It was really helpful. Could you please also provide an explanation of how the count++ and ++count expressions execute in the context of multithreading?

  • @HA-ky5vd
    @HA-ky5vd 5 หลายเดือนก่อน

    The name 'Asli Engineering' truly reflects the content on this channel.

  • @spartans-garage
    @spartans-garage 6 หลายเดือนก่อน

    awesome

  • @ShubhamSharma-ky2tf
    @ShubhamSharma-ky2tf 5 หลายเดือนก่อน

    I wish one day I could be as smart as Arpit Bhayani

  • @rishabhsharma5050
    @rishabhsharma5050 ปีที่แล้ว

    So whats the solution to make it safe

    • @AsliEngineering
      @AsliEngineering  ปีที่แล้ว +3

      Locking - optimistic and pessimistic. Videos on those topics are already out on my channel.

    • @rajibmajumder9564
      @rajibmajumder9564 ปีที่แล้ว +1

      std::atomic count; count++;