Program vs Process (low level concepts)

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 70

  • @CoreDumpped
    @CoreDumpped 2 месяца назад +78

    I just noticed that you've already posted this. While I wasn't sure which of my videos you were going to react to, I knew you were going to add value to it and now that I see it, you definitely did. Thanks for the support!

    • @NeetCodeIO
      @NeetCodeIO  2 месяца назад +18

      Thanks for the fantastic videos!! So glad you started a RUclips channel, there's no one out there who makes videos quite like yours!!

    • @babyfox205
      @babyfox205 Месяц назад

      Amazing content guys ❤❤❤

  • @priceton_braswell
    @priceton_braswell 2 месяца назад +63

    nothing beats coffee and neetcode on a Saturday morning

    • @snowman4933
      @snowman4933 2 месяца назад +1

      or Saturday night

    • @ZackWhitbord
      @ZackWhitbord 2 месяца назад

      Way better than sex. either way though, I dump my core

    • @hrshlgunjal-1627
      @hrshlgunjal-1627 2 месяца назад +1

      or Sunday morning

  • @DavidDiaz-fu5hb
    @DavidDiaz-fu5hb 2 месяца назад +11

    Yes, it was actually a fun video. It does involve a bit of abstraction because we’re overlooking many things, like pagination or virtual memory related to how the operating system manages memory and how all of this is translated to physical addresses by the MMU. I know the video’s intention was just to explain the difference between a process and a program, but the creator also tried to touch on memory, so I believe it’s important to clarify those concepts for a deeper understanding :)

  • @cemreomerayna463
    @cemreomerayna463 2 месяца назад +7

    Hey! To clarify the confusion at around 2:00, concurrency has been around in the systems programming for a long time. UNIX itself, along with its predecessor MULTICS, had time-sharing in its earliest forms. However, when the first personal computers came into the market in the late 70's they did not use operating systems that supported parallelization due to hardware limitations.

  • @adambickford8720
    @adambickford8720 2 месяца назад +8

    As usual, java is very clever :)
    You do get 1 jvm process per java application, but multiple instances of the jvm can share common parts. Google 'java class data sharing'.
    In java Strings are 'interned' so string literals are indeed shared in a pool.
    public static void main(String[] args) {
    var interned = "foo";
    var forcedNew = new String("foo");

    System.out.println(interned == forcedNew);
    System.out.println(interned.equals(forcedNew));

    var manuallyInterned = forcedNew.intern();
    System.out.println(interned == manuallyInterned);
    System.out.println(interned.equals(manuallyInterned));
    }

  • @robchr
    @robchr 2 месяца назад

    Java byte code will be interpreted and then just in time (JIT) compiled when run on the Java virtual machine (JVM). Also you can compile Java byte code directly into assembly, skipping interpretation, using Graal native image.

  • @henrithomas8333
    @henrithomas8333 2 месяца назад +1

    I was unclear on the Python interpreter as well. Recently though I’ve come to loosely understand it like he explains:
    The interpreter has a virtual machine and a compiler. When running a py script, the source code is compiled to bytecode then that bytecode is put into memory. The Python virtual machine then runs that bytecode.
    Great video!

  • @lakshmanshankar
    @lakshmanshankar 2 месяца назад +1

    17:50 This part is very interesting.

  • @Matem-sc1ic
    @Matem-sc1ic 2 месяца назад +5

    I love you both guys❤❤

  • @kaankahveci1153
    @kaankahveci1153 2 месяца назад

    I would love to see videos like this from you. Keep em coming please!

  • @hamoodhabibi7026
    @hamoodhabibi7026 2 месяца назад

    I really like this format! and learning how things work

  • @basil9633
    @basil9633 2 месяца назад

    This is quite literally perfect as I am studying OS systems rn

  • @GalaxyHomeA9
    @GalaxyHomeA9 2 месяца назад

    I would you love if you make videos on branch education.
    This channel is amazing specially the videos of how ram, hard disk works at low level which gives a true insight of what's going on inside the computer.

  • @SoledadDelSol
    @SoledadDelSol 2 месяца назад

    @NeetcodeIO ~5:14 , Rust compiler does the same thing! Saves hard coded strings into the binary (via the Rust book). I learned a bunch from that book that I'm sure reflects alot of base concepts with compiling code in C. Would recommend giving it a read

  • @vbachris
    @vbachris Месяц назад

    3:49 machine code contains binary instructions AND static binary data that belongs to the program. imagine older computer games. there were instructions to execute for the game to make sense AND there was information stored regarding sprites or pixel images.

  • @licokr
    @licokr 2 месяца назад

    When I learned programming, it taught me java is a compiled language but now thinking of it, java code is compiled and it turns into byte code and JVM which interpret java code is used to interpret the byte code. So that makes sense. I really should stop trying to divide which one should be in a side. I liked to hear your opinions for the video, thanks!

  • @smonster
    @smonster Месяц назад

    could you make more reaction videos to core dumped? It’s really helpful for learning I feel like.

  • @siddhantkamble9502
    @siddhantkamble9502 2 месяца назад

    This was a cool video. And now I also discovered a new awesome channel. Thank you Mr. NeetCodeIO

  • @DanielKonyvka
    @DanielKonyvka 2 месяца назад

    Guys, thank you, you made my day.🤩

  • @monkeygame7
    @monkeygame7 2 месяца назад

    You actually don't have to worry about stack overflow in your recursive functions if you can make them tail recursive (and your language supports that optimization [rip python]). Such a cool technique I learned about recently!

  • @shakkar23
    @shakkar23 2 месяца назад +1

    4:53 think lookup tables, in low level programming languages it's compiled into the .ro_data section of the executable (assuming x86), and there are equivalent sections for other architectures :)

    • @shakkar23
      @shakkar23 2 месяца назад

      5:25 if you went down here it wouldn't be operating system information but rather the distinction of read only strings versus dynamic modifiable strings in C

    • @shakkar23
      @shakkar23 2 месяца назад

      7:43 fun fact in the data section some doesn't changes, like you wouldnt want the LUT to change or global constants, but the parts that do are where globals live, or at least the static parts of the globals like an int, but an int* would still need to allocate for where it's pointing to (unless it's pointing to another global lol)

    • @shakkar23
      @shakkar23 2 месяца назад

      9:07 it can vary in contents not size haha

    • @shakkar23
      @shakkar23 2 месяца назад

      11:23 this would be fine, since it would hopefully be in the data which can be whatever size it needs (but I hope youd never exceed your predetermined size limit)

  • @zacki5663
    @zacki5663 2 месяца назад

    this is all day-1 learnings for anyone who does reverse engineering or builds compilers, desktop applications, embedded software etc. where this is a gap is for people doing mostly services and cloud stuff

  • @jenex5608
    @jenex5608 2 месяца назад

    A program is a set of instructions given to a computer to execute
    A process : Is simply a running program.

  • @paca3107
    @paca3107 2 месяца назад

    core dumped is a pure gold if you are interested in low level.

  • @BachenBenno99
    @BachenBenno99 2 месяца назад

    Doesn’t data within the executable file maybe mean stuff like what object files the executable has to be linked to?

  • @sahilverma_dev
    @sahilverma_dev 2 месяца назад

    need more videos like this

  • @sri_harsha_dv
    @sri_harsha_dv 2 месяца назад

    So can we think of program as a class (blueprint) and process as an instance of it?

  • @omerali9412
    @omerali9412 2 месяца назад +1

    great video

  • @jonphelan707
    @jonphelan707 2 месяца назад

    There once was a Notion so fine,
    Whose data was stored in SQLite's design.
    It synced with great care, But a NULL pointer was there,
    Now my queries are causing a segfault in my mind!

  • @asagiai4965
    @asagiai4965 2 месяца назад +1

    A very nice (I guess ) reaction video.
    I like Core Dumped. He can explain this low level concept clearly.
    Program vs Process -> In reference to what I'm working. Program is the whole instruction set.
    Process is the one working on those instruction.
    This is why I think you can't have multiple programs.
    But you can have multiple processes.

  • @optimistcarrot4915
    @optimistcarrot4915 2 месяца назад

    5:20 Data section of a program is immutable during run time as far as I know

  • @BilalShaikh-tn9wu
    @BilalShaikh-tn9wu 2 месяца назад

    do you ever plan on doing like an OS course? ngl if you did I think I would buy premium lol

  • @moose-1
    @moose-1 2 месяца назад +4

    Lovin this style of Neetcode. Just gotta pump up the commentary length to match Primeagen.

    • @Tobsson
      @Tobsson 2 месяца назад +3

      There isn't enough time in a day for another prime. I usually skip all his videos that's longer than 30 mins because who has time!?

    • @dashdoom8452
      @dashdoom8452 Месяц назад

      please god no

  • @jmbrjmbr2397
    @jmbrjmbr2397 2 месяца назад

    Are you solving OverTheWire?

  • @yonatanbeyn8557
    @yonatanbeyn8557 2 месяца назад

    Hi neetcode I guess you need to understand the difference between Harvard vs Neumann architecture , to fully understand the deference between data and cpu instruction. The executable is the ELF file which is specific format the Linux kernel understands and prepares to execute

    • @yonatanbeyn8557
      @yonatanbeyn8557 2 месяца назад

      ELF stand for executable and linkable format . Which is the final product of compilation it carries some metadata and a lot of staff

  • @henrikfredriksen4735
    @henrikfredriksen4735 Месяц назад

    I like when you get to technical, please don't shut up!

  • @optimistcarrot4915
    @optimistcarrot4915 2 месяца назад

    I like the pun at 10:25 a video about processes is already scheduled

  • @nexovec
    @nexovec 2 месяца назад

    Once you learn what the actual distinction is, the people who nitpick on this start seeming like genuine dummies.

  • @samarthjain5015
    @samarthjain5015 2 месяца назад

    How can you know for certain when AI tools answer your questions? Especially Gemini, that thing is so bad.

  • @nikos4677
    @nikos4677 2 месяца назад

    4:12 In case he doesnt respond data contains stuff like char literals

  • @mykod9651
    @mykod9651 2 месяца назад +1

    would you consider going into Academia? just going by what you said , building is not your priority but learning how things work. I get that and I think Im the same way. You actually might be a good teacher and would care about what students learn. just my 2 cents

    • @idkbro7171
      @idkbro7171 2 месяца назад

      Keep the change mate

  • @ZackWhitbord
    @ZackWhitbord 2 месяца назад +1

    I dumped my core to this

  • @TreeLuvBurdpu
    @TreeLuvBurdpu Месяц назад

    And he does all that in PowerShell

  • @dima13693
    @dima13693 2 месяца назад +2

    4:40 - i'm surprised you're using GPT. I thought it lies with confidence so I completely discounted it for any serious use.

    • @HarshShah465
      @HarshShah465 2 месяца назад

      This was not a serious use.

  • @goedeck1
    @goedeck1 2 месяца назад

    The script is the same as the source code?

  • @kingcoder31aug
    @kingcoder31aug 2 месяца назад

    Make a course on system design

    • @HarshShah465
      @HarshShah465 2 месяца назад +1

      Why do people need course for everything

    • @kingcoder31aug
      @kingcoder31aug 2 месяца назад

      @@HarshShah465 To learn everything that need to be learned and unfamiliar to us

    • @HarshShah465
      @HarshShah465 2 месяца назад

      Have you ever wondered how do they acquire knowledge and make course?

    • @HarshShah465
      @HarshShah465 2 месяца назад

      Why can't you learn by yourself without course?

    • @kingcoder31aug
      @kingcoder31aug 2 месяца назад

      @@HarshShah465 Legends told , don't reinvent the wheel. If somebody has that knowledge acquire from them

  • @xalspaero
    @xalspaero 2 месяца назад

    8:46 recursion is actually not good.
    lol. is this satire?

    • @XtenstialKrysis
      @XtenstialKrysis 2 месяца назад

      No its not satire. recursion can quickly exhaust your memory and must be avoided as far as possible . You dont want the risk of stack overflowing when the problem could have been solved using other strategies.

    • @xalspaero
      @xalspaero 2 месяца назад

      @@XtenstialKrysis for some things (trees for example) recursion is a far more elegant solution. if your stack space is extremely limited, all you need to do is guard against overflow same as a NULL pointer or whatever other hazard.

    • @randomrfkov
      @randomrfkov 2 месяца назад

      Yes. It is not good for most functions.
      If you can write it functionally/procedurally, do it.
      If not, use recursion (function calling a function with current state variables as arguments).