Mastering Concurrency in Python: Create faster programs using concurrency, asynchronous, multithreading, and parallel programming

Quan Nguyen

  • 出版商: Packt Publishing
  • 出版日期: 2018-11-24
  • 售價: $1,980
  • 貴賓價: 9.5$1,881
  • 語言: 英文
  • 頁數: 446
  • 裝訂: Paperback
  • ISBN: 1789343054
  • ISBN-13: 9781789343052
  • 相關分類: Python程式語言
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

相關主題

商品描述

Immerse yourself in the world of Python concurrency and tackle the most complex concurrent programming problems

Key Features

  • Explore the core syntaxes, language features and modern patterns of concurrency in Python
  • Understand how to use concurrency to keep data consistent and applications responsive
  • Utilize application scaffolding to design highly-scalable programs

Book Description

Python is one of the most popular programming languages, with numerous libraries and frameworks that facilitate high-performance computing. Concurrency and parallelism in Python are essential when it comes to multiprocessing and multithreading; they behave differently, but their common aim is to reduce the execution time. This book serves as a comprehensive introduction to various advanced concepts in concurrent engineering and programming.

Mastering Concurrency in Python starts by introducing the concepts and principles in concurrency, right from Amdahl's Law to multithreading programming, followed by elucidating multiprocessing programming, web scraping, and asynchronous I/O, together with common problems that engineers and programmers face in concurrent programming. Next, the book covers a number of advanced concepts in Python concurrency and how they interact with the Python ecosystem, including the Global Interpreter Lock (GIL). Finally, you'll learn how to solve real-world concurrency problems through examples.

By the end of the book, you will have gained extensive theoretical knowledge of concurrency and the ways in which concurrency is supported by the Python language

What you will learn

  • Explore the concepts of concurrency in programming
  • Explore the core syntax and features that enable concurrency in Python
  • Understand the correct way to implement concurrency
  • Abstract methods to keep the data consistent in your program
  • Analyze problems commonly faced in concurrent programming
  • Use application scaffolding to design highly-scalable programs

Who this book is for

This book is for developers who wish to build high-performance applications and learn about signle-core, multicore programming or distributed concurrency. Some experience with Python programming language is assumed.

Table of Contents

  1. Concurrent and Parallel Programming - An Advanced Introduction
  2. Amdahl's Law
  3. Working with Threads in Python
  4. Using the �with' Statement in Threads
  5. Concurrent Web Scraping
  6. Working with Processes in Python
  7. The Reduction Operation in Processes
  8. Concurrent Image Processing
  9. Introduction to Asynchronous I/O
  10. Asyncio: Pros and Cons
  11. TCP with Asyncio
  12. Deadlock
  13. Starvation
  14. Race Conditions
  15. The Global Interpreter Lock
  16. Designing Lock-Free and Lock-Based Concurrent Data Structures
  17. Memory Models and Operations on Atomic Types
  18. Building a Server from Scratch
  19. Testing, Debugging, and Scheduling Concurrent Applications

商品描述(中文翻譯)

沉浸於 Python 並發的世界,解決最複雜的並發程式設計問題

主要特點
- 探索 Python 中並發的核心語法、語言特性和現代模式
- 理解如何使用並發來保持數據一致性和應用程式的響應性
- 利用應用程式框架設計高可擴展的程式

書籍描述
Python 是最受歡迎的程式語言之一,擁有眾多庫和框架,能夠促進高效能計算。在 Python 中,並發和並行在多處理和多執行緒方面至關重要;它們的行為不同,但共同的目標是減少執行時間。本書作為並發工程和程式設計中各種進階概念的全面介紹。

《掌握 Python 中的並發》從介紹並發的概念和原則開始,涵蓋從 Amdahl 法則到多執行緒程式設計,接著闡述多處理程式設計、網頁爬蟲和非同步 I/O,以及工程師和程式設計師在並發程式設計中面臨的常見問題。接下來,本書涵蓋 Python 並發中的多個進階概念及其與 Python 生態系統的互動,包括全域解譯器鎖(GIL)。最後,您將通過範例學習如何解決現實世界中的並發問題。

在本書結束時,您將獲得有關並發的廣泛理論知識,以及 Python 語言如何支持並發的方式。

您將學到的內容
- 探索程式設計中的並發概念
- 探索使 Python 能夠實現並發的核心語法和特性
- 理解正確實現並發的方法
- 抽象方法以保持程式中的數據一致性
- 分析在並發程式設計中常見的問題
- 使用應用程式框架設計高可擴展的程式

本書適合對象
本書適合希望構建高效能應用程式並學習單核心、多核心程式設計或分散式並發的開發人員。假設讀者對 Python 程式語言有一定的經驗。

目錄
1. 並發與並行程式設計 - 進階介紹
2. Amdahl 法則
3. 在 Python 中使用執行緒
4. 在執行緒中使用 'with' 語句
5. 並發網頁爬蟲
6. 在 Python 中使用進程
7. 進程中的歸約操作
8. 並發圖像處理
9. 非同步 I/O 介紹
10. Asyncio:優缺點
11. 使用 Asyncio 的 TCP
12. 死鎖
13. 餓死
14. 競爭條件
15. 全域解譯器鎖
16. 設計無鎖和基於鎖的並發數據結構
17. 記憶體模型和原子類型的操作
18. 從零開始建立伺服器
19. 測試、除錯和排程並發應用程式