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

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

    Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses.

  • @vighnesh153
    @vighnesh153 5 ปีที่แล้ว +99

    You forgot to add a key difference between the two. In multiprocessing, we distribute the processes on different CPU cores so that the other cores are not idle and this is true multi-tasking. However, in multithreading, we synchronously execute the threads on the same CPU core and the threads wait for the CPU core to be idle to execute themselves. But as this happens fast, it looks like multi-tasking is happening. I believe this to be the most important difference.

    • @codebasics
      @codebasics 5 ปีที่แล้ว +16

      Hey Vignesh, I disagree that in multithreading architecture threads always execute on single core. Multiple threads can execute on multiple cores giving you a true parallelism. Check this: stackoverflow.com/questions/11835046/multithreading-and-multicore-differences

    • @irina_divine
      @irina_divine 5 ปีที่แล้ว +5

      @@codebasics Python's Global Interpreter Lock enforces the rule Vighnesh mentioned above.

    • @Norhther
      @Norhther 3 ปีที่แล้ว

      @@irina_divine you can bypass it pretty easily

    • @shaikhnaima6512
      @shaikhnaima6512 2 ปีที่แล้ว

      @@codebasics o

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

      For CPython (The most famous one), GIL prevents a thread from using multiple processors. I think @vighnesh153 is correct for CPython.

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

    One of the best videos which clarifies distinction between process and threads

  • @siriuskais
    @siriuskais 6 ปีที่แล้ว +6

    best memorizable visual examples so far. I pretty like your style to make the content understandable:D

  • @akhtarshaikh5594
    @akhtarshaikh5594 5 ปีที่แล้ว +2

    Hi codebasics ,
    When should I use multiprocessing?
    When should I use multithreading ?
    I hope u got my point.
    Thanks,

    • @codebasics
      @codebasics 5 ปีที่แล้ว

      Multithreading is light weight version of multiprocessing. You should use it as first preference. Multiple processes are littl difficult to manage but in python programming language due to GIL multithreading doesn't give you true parallelism, on this Occasion it makes sense to use multiprocessing

  • @nobodybutyou1032
    @nobodybutyou1032 7 ปีที่แล้ว +16

    The best explanation so far!

  • @jayantghorpade
    @jayantghorpade 2 ปีที่แล้ว

    Adorable concepts are clear in this video

  • @manualvarado2212
    @manualvarado2212 5 ปีที่แล้ว

    Appreciate this video, it was very digestible, and knowing that multiple threads exist in a single process, but they share the same address in memory that the process does, is exactly what I needed to know!

    • @codebasics
      @codebasics 5 ปีที่แล้ว +2

      Perfect Manu. You are an expert now 👍😊

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

    Excellent explanation! Very easy to understand, saves time. Cheers to you

  • @royywalls9356
    @royywalls9356 7 ปีที่แล้ว

    Can you please explain what is the meaning of the "processes are different programs written by different companies, so they have to run separately"?

  • @dinesh.p8642
    @dinesh.p8642 3 ปีที่แล้ว

    Thank you Dhaval Sir.

  • @infopackrat
    @infopackrat 5 ปีที่แล้ว

    That's the best explanation I've heard so far

    • @elhumillapelotudosdescereb8911
      @elhumillapelotudosdescereb8911 4 ปีที่แล้ว

      that's actually the worst I have ever seen, the skinny and fat guys are stupid and confusing comparations.

  • @codebasics
    @codebasics 4 ปีที่แล้ว

    Step by step roadmap to learn data science in 6 months: th-cam.com/video/H4YcqULY1-Q/w-d-xo.html
    Full python course: th-cam.com/play/PLeo1K3hjS3usILfyvQlvUBokXkHPSve6S.html
    Machine learning tutorials with exercises:
    th-cam.com/video/gmvvaobm7eQ/w-d-xo.html

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

    That was a perfect and great explonation! Thanks you very much sir!

  • @govindrai93
    @govindrai93 5 ปีที่แล้ว +2

    This is seriously excellent content. Thank you.

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

    Thank you so much for this video! It helped to clear a lot of my doubts on threads :)

    • @codebasics
      @codebasics 3 ปีที่แล้ว

      I am happy this was helpful to you.

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

    I'm so impressed by your explanations. Got a new sub.

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

    Thank you for a good video! I have one question, that I hope you can help me with. If we stay in you example with Power Point, what could a thread then be? What kind of tasks could it be?
    I hope you can help me with some examples.

    • @xxMpEGxx
      @xxMpEGxx 6 ปีที่แล้ว

      @codebasics: but you said that processes can communicate with eachother via shared memories so if threads have a shared memory whats the difference if processes communicate via a shared memory too?

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

    So Multiprocessing is effectively multitasking with applications (and other programs)
    And Multithreading is effectively multitasking within applications (and other programs)
    Makes a lot of sense.
    Edit: of course multiprocessing can also refer splitting tasks up between cores, but that can be used for either things.

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

    thank you for good explanation

  • @salrite
    @salrite 6 ปีที่แล้ว

    What are some usecases/benefits of using Multithreading/MultiProcessing?

  • @bii710
    @bii710 7 ปีที่แล้ว +4

    You did a great job in explaning the difference between these two... Keep it up

  • @sns_rulz
    @sns_rulz 4 ปีที่แล้ว

    A great explanation thank you

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

      Glad it was helpful!

  • @iarrcsim2323
    @iarrcsim2323 4 ปีที่แล้ว

    How does hardware support for multiple threads in the same core improve performance when you use lots of threads in software? Let's say you want to perform 3D rendering and heavily use the CPU for several minutes or hours. I can see multiple cores helping a lot because each core could run each thread.

  • @vvsur5sh
    @vvsur5sh 7 ปีที่แล้ว

    can you provide an example for memory leaks in threads ?

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

    Is there a version without the background music? Thanks

    • @IvanTomasik
      @IvanTomasik 6 ปีที่แล้ว

      Thank you! Great videos keep doing :)

  • @dippatel1739
    @dippatel1739 7 ปีที่แล้ว +2

    best tutorials!! keep doing it

  • @shodan658
    @shodan658 6 ปีที่แล้ว

    Thank you so much; that was a very good introduction into the topic; a very good video! :)

  • @NathanPhippsONeill
    @NathanPhippsONeill 6 ปีที่แล้ว

    Such a great video... you cleared up so much! Thank You

  • @poppylilly7428
    @poppylilly7428 5 ปีที่แล้ว

    Great video !!! Very informative

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

    Great video. Whats the name of the song in the background?

  • @vvsur5sh
    @vvsur5sh 7 ปีที่แล้ว

    what is stack memory and instruction pointer ?

  • @Piliponful
    @Piliponful 7 ปีที่แล้ว

    You really good at explanation. I only watched this video, and read comments. and its already seems obvious! Even accent isn't a problem when you know how to explain concept! Thanks!
    P.S. new feature of youtube with pointing to other videos in the end is also very good decision. It shows in some way that you are serious about channel and it also...
    bored to write:) Good job tho'.

  • @TheMoises1213
    @TheMoises1213 7 ปีที่แล้ว

    Still don't know what multithreading is. Multiprocessing is simply cores doing multiple things at once

  • @rafsanjanimuhammod309
    @rafsanjanimuhammod309 7 ปีที่แล้ว

    Thankyou, Sir !
    Really a nice one.

  • @DukeJon1969
    @DukeJon1969 7 ปีที่แล้ว

    very succinct and clear explanation ;)

  • @sauravkumar-gl8wg
    @sauravkumar-gl8wg 2 ปีที่แล้ว

    thanks

  • @drcvagos-iu
    @drcvagos-iu 7 ปีที่แล้ว

    do you have other channel name kudvenkat ?

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

    3:30 -- well, the same counts for threads too, as long as you don't do something retarded on purpose, such as making two separate threads execute something on things stored within the same memory space.

  • @864productions6
    @864productions6 2 ปีที่แล้ว

    yo is that the busy works beat theme song lol

  • @sehrgrossesglied5000
    @sehrgrossesglied5000 7 ปีที่แล้ว

    thumbs up for the lightweight-heavyweight metaphor :D

  • @shreyashchacharkar8323
    @shreyashchacharkar8323 8 หลายเดือนก่อน +1

    please remove background music

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

    That picture at 3:10 lol

  • @Noldy__
    @Noldy__ 7 ปีที่แล้ว

    I am here going through a home curriculum that is giving me headaches to understand github.andela.com/homestudy/
    Please do more of this. I tend to understand concepts in such a way than reading.

    • @Noldy__
      @Noldy__ 7 ปีที่แล้ว

      Yeah. I just need someone to break the concepts down like the way you are doing. Will keep an eye out for them. Thanks.

  • @Terminator0512
    @Terminator0512 5 ปีที่แล้ว

    V nice

    • @codebasics
      @codebasics 5 ปีที่แล้ว

      Branded, thanks for the feedback

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

    cool

  • @hemachandiran3984
    @hemachandiran3984 3 ปีที่แล้ว

    Anyone in 2021

  • @Noldy__
    @Noldy__ 7 ปีที่แล้ว

    And what is a memory leak? :D

    • @irina_divine
      @irina_divine 5 ปีที่แล้ว

      When a process or compiler/interpreter doesn't free memory when suppose to or when the developer in the case that the memory is completely managed by the developer, the developer doesn't safely and or properly free the memory either upon uninitialization or when the memory is not in use at all.

  • @philipT8989
    @philipT8989 4 ปีที่แล้ว

    So what is her husband doing?

  • @UnknownGamer-lw7zp
    @UnknownGamer-lw7zp 2 หลายเดือนก่อน

    3:09💀

  • @juanrivera9371
    @juanrivera9371 5 ปีที่แล้ว

    I dont speak english brou

  • @CanMetan
    @CanMetan 7 ปีที่แล้ว +15

    Horrible explanation. After a 4 minute video, I still have no idea how is a process functionally different from threads.
    3:30 was tasteless and disgusting as well. Disrespectful.

    • @TheMoises1213
      @TheMoises1213 7 ปีที่แล้ว

      Kazathul lmaoo i feel you painnnn. Many videos and reading books, still can't understand wth that is. People never get straight to the point🤦🏿‍♀️

    • @darkside3ng
      @darkside3ng 6 ปีที่แล้ว +5

      Kazathul. Every time that you start a program the operating system (Windows Linux, OSX) creates in the memory a restrict space of memory to store variables and the program by it self. If you open the notepad twice, they will run as two different processes for the MS Windows, for instance.
      In many (simple) computer programs you have a main loop or a sequence of instructions that you have to do.
      -----------------------------------------
      var a, b, c;
      int main()
      {
      loop()
      {
      your code here
      }
      }
      ---------------------------------------
      To the above code if you start twice, the OS will create a copy of the code and the variables, as if you have two equals car in your garage. They are equal, but ...
      But, if you need to do a task, or more, in parallel to another, it is necessary to call delegate this to a specific code and this is possible in two ( ways), or you call a second program to do this or you call a thread. A second program for the specific task have their on space of memory their own code, but if comes with a cost. You have more problems to share information between this two tasks and you have a cost of memory. A way to do this more easily is to call a internal function of the program ans start a thread
      -----------------------------------------
      int funcA()
      {
      }
      var a, b, c;
      int main()
      {
      // Goes to do something else
      t = thread('funcA');
      t.start(); // Calls the function A in parallel
      // The last calls doesn't block the code and the loop starts
      loop()
      {
      your code here
      }
      }
      ---------------------------------------
      In a nonthread program if you call a funcA(), the main program it is blocked until the funcA() is finished, but in a thread program both is executed.
      Another point is that when a thread of the funcA() is executed, the variables a, b and c can be accessed. It doesn't happen in a separate process.

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

      I absolutely love the clarity of this response. Cleared up the terms that I (probably we) were stuck on. AND the fucken savagery that accompanied the response. Absolutely deserved! lmfao 5 star response.

    • @majora4prez543
      @majora4prez543 6 ปีที่แล้ว

      you're hilarious kaza