|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/multithreading_parta/
课程评论:没有评论
课程名称:Part A - 多线程与线程同步 - Pthreads 课程概述: 本课程是“多线程大师班”系列课程的第一部分,旨在为希望掌握多线程基础概念的学习者提供深入指导。课程内容基于Linux平台上的Pthreads(POSIX线程)库,虽然使用C语言作为演示语言,但讲解的概念适用于任何编程语言,对C++程序员尤其有益。学习者将深入理解多线程的底层原理,避免过度的抽象。 本课程将详细讲解包括死锁、互斥、原子性、线程同步、竞态条件、线程的fork等在内的多个核心多线程概念,并通过代码示例进行演示。完成本课程的学习后,您将为即将推出的包含高级多线程概念和迷你项目的续集课程打下坚实基础。课程强调实践,您将亲手编写大量的多线程代码,同时还会覆盖面试中常考的知识点和问题。 课程目录: 1. **理解线程** * 线程创建与终止 * 线程创建时的竞态条件 * 向线程函数传递参数 * 多线程程序的栈内存管理 * 线程调度 2. **理解并发与并行** * 串行、并发与并行 * 并发进程设计示例 * 线程作为轻量级进程 * 工作重叠与非重叠 3. **可连接与分离线程** * 可连接与分离线程的区别 * 如何连接线程 * 连接哪个线程 * Map-Reduce 程序示例 4. **线程间通信** * 回调函数与函数指针 * 实现线程间通信的最佳实践 * 通知链的实现 * 发布-订阅模型 * 如何订阅/取消订阅 * 如何向订阅者发送通知 5. **异步线程取消** * 线程取消概述 * 异步与延迟的线程取消 * 异步线程取消问题 * 资源泄露 * 不变性 * 死锁 * 线程清理处理程序 * 防止资源泄露:数据结构损坏 - 不变性 * 取消引起的死锁 6. **延迟取消** * 延迟取消的理解 * 延迟取消的实现 7. **监听线程 - 职责委托** * 监听线程的作用 * 设计监听线程 * 代码修改与演示 * 被阻塞线程的取消 8. **线程同步** * 关键代码段 * 互斥量规则 * 互斥量锁定 * 互斥量锁定 - 代码锁定 * 互斥量锁定 - 数据锁定 * 基于互斥量的API * 互斥量的实际应用 9. **死锁** * 死锁的定义与原因 * 死锁发生的必要条件 * 互斥量锁定顺序导致的死锁 10. **条件变量** * 条件变量(CV)的理解 * CV与互斥量的区别 * Wait() & Signal() * 生产者-消费者线程同步 * 虚假唤醒 * 线程特定与资源特定的CV * 广播CV * 实现生产者-消费者问题 11. **哲学家就餐问题** * 问题描述 * 数据结构设置 * 编程作业设置 * 流程图/算法讨论 * 最终实现(分步) 12. **信号量** * 信号量的介绍 * 信号量与互斥量的区别 * 信号量的工作原理 * 严格交替问题 * 信号量的实现 * 信号量类型:强信号量与弱信号量 **后续高级多线程主题预告(进行中):** 1. 线程暂停与恢复 2. 线程池 3. 标准问题 - 读者/写者问题 4. 实现线程屏障 5. 实现线程监视器 6. 使用监视器解决同步问题 7. 死锁检测与预防 8. 等待队列 9. 使用线程实现定时器 10. 如何fork一个多线程进程 11. 使用命名信号量进行进程同步 **精选学员评价:** 课程内容非常棒。对于像我这样的软件开发者来说,能够学习到更高级的主题非常难得。本课程提供了大量宝贵的、与实际应用相结合的知识,深入讲解了C语言多线程的实际应用场景,并支持动手实践。讲师的讲解清晰,信息量大,代码示例丰富。尤其是在网络编程方面,讲师拥有深厚的专业知识,课程案例也多以此为导向。对课程印象深刻,非常有趣,期待讲师的其他课程。 课程内容非常出色,强烈推荐。非常精确地实现了课程开始时设定的目标。 1. **大量实践代码**:通过编写大量代码,增强了使用pthread库的信心,也学习了assert函数的重要性。 2. **深入同步方法**:讲师深入讲解了各种同步方法,并展示了如何使用mutex和condition variable等基础工具来构建它们,这增强了学习者的信心,也使其能够在没有内置支持的库或操作系统中使用自定义同步机制。这是本课程最大的亮点。 3. **响应迅速的团队**:CSE Practicals团队对学习者的提问响应非常及时。 **学习者感言:** 我刚刚完成了这门课程,无法给出更高的评价了。这是一门优秀的多线程课程,达到了它最初预设的目标。现在我将继续学习课程的续集。
Welcome to the Course Series on Multi-Threading - The Master Class Course on Threads.This course is for those who want to develop fundamental concepts on Multi-threading and related concepts. In this course, we shall be going to cover Multi-threading concepts based on Pthreads (POSIX threads) on the Linux platform. Though We use the C language to demonstrate the concepts, concepts hold good for any programming language. This course is equally valuable for C++ programmers. Other language programmers may also find this course useful as we explain Multithreading concepts close to the ground zero levels No Abstraction.We shall discuss several concepts involved in multithreading and demonstrate each concept through a sample program. Several Important Concepts include but are not limited to - Deadlocks, Mutual Exclusion, Atomicity, Thread Synchronization, Race Conditions, Thread forking, and many more.In the Next Installment of this course, we shall extend our knowledge of Multi-threading to Advance Concepts, including mini-projects on Multithreading and Thread Synchronization. At each stage of this Course series, you shall be writing a lot of multi-threaded Codes. So be ready to Master the Multi-threading. Along the journey, we shall cover several interview-favorite topics and Questions to prepare you alongside for interviews.Best of luck!Table Of Contents:= = = ======= = = = 1. Understanding ThreadsThread Creation & TerminationRace condition on Thread CreationPassing Argument to Thread FunctionStack Memory Mgmt for Multi-threaded ProgramsThread Scheduling2. Understanding Concurrency and ParallelismSinglularism Vs Concurrency Vs ParallelismConcurrent Process Design - 2 ExamplesThreads as Light Weighted ProcessOverlapping and Non-Overlapping Work3. Joinable and Detached ThreadsJoinable Vs Detached ThreadsHow to Join a threadWhom to Join?Sample - Map-Reduce Program4. Inter Thread CommunicationUnderstanding Callbacks and Function PointersBest way to implement ITCImplementing Notification ChainsA Publisher Subscriber ModelHow to Subscribe/UnSubscribeHow to send Notification to Subscribers 5. Asynchronous Thread CancellationThread CancellationAsynchronous and Deferred Thread CancellationProblem with Async Thread CancellationResource LeakingInvariantsDeadlocksConcept of Thread Cleanup HandlersPrevent Resource Leaking Data Structure Corruption - InvariantsCancellation causing Deadlocks6. Deferred CancellationUnderstanding Deferred CancellationImplementation7. Listener Threads - Responsibility DelegationWhy Listener threads?Designing Listener threadsCode Changes and Demo Cancellation of blocked Threads8. Thread SynchronizationCritical SectionMutex RulesMutex LockingMutex Locking - Code LockingMutex Locking - Data LockingMutex based APIsMutexes in Action9. DeadlocksWhat are deadlocks and why do they happen?Necessary conditions for Deadlock to happenMutex lock Ordering Causing Deadlocks 10. Condition VariablesUnderstanding CVCV Vs MutexWait( ) & Signal( )Producer-Consumer Thread SynchronizationSpurious Wake UpsThread Vs Resource Specific CVBroadcasting a CV Implement Producer-Consumer Problem 11. Dining Philosopher ProblemProblem DescriptionData Structures Setup Assignment Program SetupFlowchart/Algorithm DiscussionFinal Implementation (Step by Step )12. SemaphoresIntroductionSemaphores Vs Mutexes How Semaphore work Strict Alternation ProblemSemaphore ImplementationSemaphore TypesStrong and Weak SemaphoresListing Upcoming Advanced Multi-Threading Topics for Sequel Course ( Under Progress )= = = = = = = = = = = = = = = = = = = = = = 1. Pausing and Resuming Threads 2. Thread Pools3. Standard Problems - Reader/Writer Problem4. Implementing Thread Barriers5. Implementing Thread Monitors6. Solving Sync Problems using Monitors7. Deadlock Detection and Prevention8. Wait Queues9. Implement Timers using Threads10. How to fork a multi-threaded process11. Process Synchronization using Named Semaphores Happy Learning.Featured ReviewThis course is amazing. I'm so glad the instructor decided to offer courses on Udemy. First, it's very rare to find courses on more advanced subject matter. As a software developer, I love learning but am often disappointed that Udemy largely has beginner-oriented material (understandably so). Then there's the CSEPracticals courses. I learned a LOT here. This is some valuable, real world stuff. It's incredibly useful to learn how multi-threading in C is actually applied in real world use cases and to implement these use cases on your own. The instruction was clear, the information valuable. The code samples are plentiful. The instructor is clearly very knowledgeable about networking and so the course examples tend to lean in that direction. I'm very impressed and had a LOT of fun with this course. I can't wait to check out the other ones by CSEPracticals.I have just finished this course, and I cannot recommend it more. Its an excellent course on multi-threading and achieves exactly what it intends to from the start. Some features of this course 1) You write a lot of code, and you become more confident in using the pthread library ( along with some other things, I learned how important proper use of assert function can be). 2) Abishekh goes in depth on different synchronization method and shows you have to build them using fundamental tools like mutex and condition variables. This gives you a lot of confidence, and you can build your own in future in case your chosen OS or library does not have those built-in. This in my opinion is the biggest strength of the course. 3) The team of CSE Practicals is very responsive and you can expect to get a response on your queries within a very reasonable time-frame. Ongoing to the course sequel now. Ovais