|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/posix-multithreading-and-futex-programming-in-c-from-scratch/
课程评论:没有评论
课程名称:从零开始的C语言POSIX多线程与Futex编程 课程概述:在当今计算世界中,并发编程已成为必要条件。现代应用程序必须快速、响应及时,并能够同时处理多个任务。本课程旨在让学员深入、实用地理解如何在C语言中使用POSIX线程(pthreads)和Futex进行多线程编程。无论您是系统程序员、嵌入式开发人员、Linux爱好者还是计算机科学学生,本课程都将逐步讲解您所需的每一个基本概念,从基础知识到现实软件中使用的低级高性能技术。 课程内容将首先探讨进程与线程的区别,理解多线程的高效性,并学习如何安全地创建、管理和终止线程。接下来,我们将深入同步工具,如互斥锁(mutexes)、条件变量(condition variables)、自旋锁(spinlocks)、屏障(barriers),以及死锁、线程局部存储、重入函数和线程安全等高级主题。 在课程的后半部分,您将学习如何使用Futex(快速用户空间互斥量) - 一种用于快速、可扩展线程同步的Linux内核机制。我们将探讨Futex API、快速与慢速路径、内核级优化,以及Futex如何在glibc和pthreads等库的底层运作。 此外,您还将分析内存布局、线程栈,了解在多线程环境中信号的行为以及在线程工作时用户空间和内核空间之间的差异。 完成本课程后,您将能够编写稳健、线程安全且高性能的C语言多线程应用程序,深入理解内核层面的运行机制。
In today's computing world, concurrency is no longer optional - it's essential. Modern applications must be fast, responsive, and capable of handling multiple tasks at once. This course is designed to give you a deep, practical understanding of multithreading programming in C using POSIX threads (pthreads) and futex, the powerful Linux system call for user-space synchronization.Whether you're a systems programmer, embedded developer, Linux enthusiast, or computer science student, this course will walk you through every essential concept you need - starting from the basics and building up to low-level, high-performance techniques used in real-world software.You'll begin by exploring the difference between processes and threads, understand why multithreading is more efficient, and learn how to create, manage, and terminate threads safely. From there, we'll dive into synchronization tools like mutexes, condition variables, spinlocks, barriers, and advanced topics such as deadlocks, thread-local storage, reentrant functions, and thread safety.In the second half of the course, you'll learn how to use futex (Fast Userspace Mutex) - a Linux kernel mechanism for fast, scalable thread synchronization. We'll explore futex APIs, fast vs. slow paths, kernel-level optimizations, and how futex is used under the hood by libraries like glibc and pthreads.You'll also analyze memory layout, thread stacks, how signals behave in multithreaded environments, and the difference between user and kernel space when working with threads.By the end of this course, you'll be able to write robust, thread-safe, and high-performance multithreaded applications in C - with a deep understanding of what's happening behind the scenes at the kernel level.