MultiThreading In Python

所在平台: Udemy

课程主页: https://www.udemy.com/course/multithreading-in-python/

课程评论:没有评论

第一个写评论        关注课程

课程简介

课程名称:Python中的多线程编程 概述:欢迎参加“Python中的多线程编程”课程。本课程由一位软件工程师讲授,他成功通过了约16家软件公司的面试。生活中,有时没有时间准备,我们必须勇敢面对紧急情况,掌控局面,而不是被情况控制。毕竟,人生结束时,我们都将一无所获。但在面临挑战时,我们应该以一种让自己骄傲的方式去应对,十年后回想时依然会让人热血沸腾。 许多人觉得多线程对程序员来说太复杂和痛苦,学习线程编程并不容易。大多数情况下,并发编程显得有些深奥。如果你是一名程序员,而还没有开始编写并发软件,那么现在就应该开始了。随着CPU数量的增加,并发编程已从一种可选项变成了一种必需,了解并发编程的需求日益增长,每位程序员都需要掌握这一知识。 本课程以简单的编程方式帮助你学习Python多线程模块中不同多线程API的概念和使用。课程将涉及以下编程问题: 1. 创建一个线程打印“hello world”。 2. 创建5个线程,每个线程打印一次“hello world”。 3. 创建一个线程计算两个数字的和并打印结果。 4. 创建5个并行执行的线程,每个线程计算两个数字的和并打印结果。 5. 打印线程执行时的默认线程名称。 6. 创建并命名一个线程,并打印该线程的官方名称。 7. 使用日志功能打印线程名称和调试级别。 8. 创建一个不依赖主线程的守护线程。 9. 从主线程中无限等待守护线程完成执行。 10. 从主线程中等待一段时间守护线程完成执行。 11. 检查线程是否仍在活动并确认线程是否为守护线程。 12. 创建一个守护线程,并使用enumerate和join函数等待守护线程完成执行。 13. 创建三个守护线程,并使用enumerate和join函数等待它们完成执行。 14. 重写线程的run()函数。 15. 重写线程的构造函数和run()函数。 16. 创建一个线程,该线程在特定事件下无限期等待,事件由主线程设置后继续执行。 17. 创建一个线程,该线程在特定事件下等待特定时间,事件设置后继续执行。 18. 创建两个线程,在不冲突的情况下获取锁,增量计数并释放锁。 19. 主线程尝试顺序获取锁两次。 20. 使用with语句获取锁的优势。 21. 创建两个消费者线程,等待生产者线程通知资源可用。 22. 解释信号量在线程中的使用。 23. 解释threading.local()的用法。 24. Condition对象可以关联的不同锁类型。 25. 唤醒所有等待条件被设置的线程的方法。 26. 用于识别特定线程的方法。 27. 检索所有活动线程列表的方法。 28. 允许递归获取锁的锁类型。 29. Locked和Unlocked的状态/特性支持。 30. 和Unlocked相关的状态/特性支持。 31. 等待线程终止的方法。 32. 检测Python线程状态的方法。 33. 检查特定线程是否为守护线程或普通线程的方法。 34. 递归锁类型。 35. 终止阻塞线程的方法。 36. run()方法是如何被调用的。 37. _____________同步方法用于保护有限容量的资源。 通过本课程,您将能够掌握Python中多线程编程的核心概念和实践技能,提高您的编程能力和职业竞争力。

课程评论(0条)

课程详情

Welcome to the Course "MultiThreading In Python":Python Multithreaded Programming This course is from a software engineer who has managed to crack interviews in around 16 software companies.Sometimes, life gives us no time to prepare, There are emergency times where in we have to buck up our guts and start bringing the situations under our control rather then being in the control of the situation. At the end of the day, All leave this earth empty handed. But given a situation, we should live up or fight up in such a way that the whole action sequence should make us proud and be giving us goosebumps when we think about it right after 10 years.Some feel threads are too hard and painful for programmers to use. It can be difficult to get a good education in how to program with threads. Most of the times, concurrent programming remains somewhat esoteric. If you're a programmer and you're not already writing concurrent software, you should start. 100+ cores could be common ten years from now (or possibly even sooner).As the typical number of CPUs increases, concurrency is changing from a beneficial option to a necessity. That will increase demand for understanding of concurrent programming, and every programmer needs the knowledge of concurrent programming. This course contains A simplistic programming approach which helps you to learn the concepts and usage of different multi threading apis in the Multi Threading module of Python.The following programming questions are dealt in this course:1. Write a pgm to create a thread which will print 'hello world' on the screen2. Write a pgm to create 5 threads which in turn each will print 'hello world' on the screen3. Write a pgm to create a thread which adds 2 numbers and prints the result4. Write a pgm to create 5 threads which executed in parallel, each will add 2 numbers and print the result5. Write a pgm to print the default thread name while the thread is under execution6. Write a pgm which creates a thread, officially names it and tries to print the official name of the thread7. Write a pgm where in we use the logging function to print the thread name, the debug level while the thread is executing8. Write a pgm to create a thread which is not dependent on the main thread (create a daemon thread)9. Write a pgm to do the following: - Create a daemon thread - From the main thread function, wait indefinitely for the daemon thread to complete execution10. Write a pgm to do the following: - Create a daemon thread - From the main thread function, wait for a stipulated period to the daemon thread to complete execution11. Write a pgm to check if the thread is still active and is the thread a daemon12. Write a pgm to create a daemon thread, and using the enumerate and join function, wait for the daemon thread to complete execution13. Write a pgm to create 3 daemon threads, and using the enumerate and join function, wait for the deamon threads to complete execution14. Write a pgm to override the run() function of thread15. Write a pgm to override the constructor and run() functions of thread16. Write a pgm where in a thread waits for a particular event indefinitely. once the event is set by the main thread, the thread stops waiting and resumes execution17. Write a pgm where in a thread waits for a particular event for a particular period of time. once the event is set by the main thread, the thread stops waiting and resumes execution18. Write a pgm which creates 2 threads which does the following with out conflict: Acquire the lock, increment the counter value and release the lock.19. Write a pgm where in the main thread tries to acquire the lock twice in a sequential fashion20. What is the advantage of using a with statement to acquire a lock in a thread.21. Write a pgm where two consumer threads wait on the producer thread to notify them about the availability of the resource22. Explain the usage of semaphores in threads23. Explain the usage of threading. local()24. What are the different lock types a Condition object can be associated with?25. What is the method that wakes up all threads which are waiting for the condition to set26. Which method is used to identify a particular thread? 27. What is the method used to retrieve the list of all active threads?28. Which kind of lock supports the following statement: - If a thread already owns the lock, acquire() will increment the recursion level by one, and return immediately. 29. The following states/features supported by the ____________ object Locked Unlocked30. The following states/features supported by the _______________ object Locked Unlocked Owning thread Recursion level31. Which thread method is used to wait until it terminates?32. How to detect the status of a python thread?33. How to check if a particular thread is a Daemon or a normal thread ?34. Which one is reentrant lock type?35. How to terminate a blocking thread?36. How is the run() method invoked?37. _____________ synchronization method is used to secure the resources with limited capacity

课程标签

0人关注该课程

主题相关的课程