MultiThreading in Python | Creating and Managing Python Threads | Python Threading Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ย. 2024

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

  • @ChanderPareek-i3w
    @ChanderPareek-i3w 9 หลายเดือนก่อน

    I wish I had teacher like you during my college time , made complex concept so easy. thank you so much

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

    Near 11:25, is there some magic where the Thread base class automagically understand that self.param1 should be used on initialization to define args=()? I guess I expected you to still have to pass param1 into Thread's args somehow. Super helpful video!

    • @Cognitive-Programmer
      @Cognitive-Programmer  3 ปีที่แล้ว +1

      Hi
      Thanks for your comment.
      In this case I'm not using thread args() to pass the parameter in the thread function but using derived class ___init__ to have param1..
      In the run() function, I'm using self.param1 passed in __init__
      Hope it clarifies 🙏🙏🙏

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

    A same function in a for loop(within function def.) should be run in multiple thread..is it possible sir??

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

    Hey bro, how can I store all threads? I have created a sub class of thread. It has some variable which updates every seconds. I want to store all threads and get any of them and print/use that variable

  • @yt-1161
    @yt-1161 ปีที่แล้ว

    why do you need that super()__init__() method inside init ? @10:25

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

    what is the name of editor that you are using?

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

    Someone to assist. I am having issue with a socket. This is the output I get:
    Line 683: in process_request_thread self.finish_request(request, client_address) this is my code below:
    try:
    self.finish_request(request, client_address)
    except Exception:
    self.handle_error(request, client_address)
    finally:
    self.shutdown_request(request)
    Can anyone tell me what is to be corrected?

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

    you can create a thread with a function that just while True:, so the main program ends but the thread never ends...good to make viruses.

    • @Cognitive-Programmer
      @Cognitive-Programmer  2 ปีที่แล้ว +1

      Thanks for your comment..Today’s operating systems will take care of this..once the main process exits..orphaned threads should be cleared by OS.. even if they don’t do immediately.. Hope this info helps
      Thanks 🙏

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

      Still on Windows 98? :D