We may earn an affiliate commission when you visit our partners.
Course image
James Cutajar

The mood in the meeting on the 12th floor of an international investment bank was as bleak as it gets. The developers of the firm met to discuss the best way forward after a critical core application failed and caused a system wide outage.

Read more

The mood in the meeting on the 12th floor of an international investment bank was as bleak as it gets. The developers of the firm met to discuss the best way forward after a critical core application failed and caused a system wide outage.

"Guys, we have a serious issue here. I found out that the outage was caused by a race condition in our code, introduced a while ago and triggered last night." says Mark Adams, senior developer.

The room goes silent. The cars outside the floor to ceiling windows slowly and silently creep along in the heavy city traffic. The senior developers immediately understand the severity of the situation, realizing that they will now be working around the clock to fix the issue and sort out the mess in the datastore. The less experienced developers understand that a race condition is serious but don't know exactly what causes it and therefore keep their mouths shut.

Eventually Brian Holmes, delivery manager, breaks the silence with "The application has been running for months without any problems, we haven't released any code recently, how is it possible that the software just broke down?. "

Everyone shakes their heads and goes back to their desk leaving Brian in the room alone, puzzled. He takes out his phone and googles "race condition".

Sound familiar? How many times have you heard another developer talking about using threads and concurrent programming to solve a particular problem but out of fear you stayed out of the discussion?

Here's the little secret that senior developers will never share... Multithreading and Multiprocessing programming is not much harder than normal programming. Developers are scared of concurrent programming because they think it is an advanced topic that only highly experienced developers get to play with.

This is far from the truth. Our minds are very much used to dealing with concurrency. In fact we do this in our everyday life without any problem but somehow we struggle to translate this into our code. One of the reasons for this is that we're not familiar with the concepts and tools available to us to manage this concurrency. This course is here to help you understand how to use multithreading and multiprocessing tools and concepts to manage your parallel programming. It is designed to be as practical as possible. We start with some theory around parallelism and then explain how the operating system handles multiple processes and threads. Later we move on to explain the multiple tools available by solving example problems using concurrent programming.

In this course we use the Python language, however the concepts learned here can be applied to most programming languages.

All code in this course can be found on github, username/project: cutajarj/multithreadinginpython

Enroll now

What's inside

Learning objectives

  • Discover how to create responsive and high performance software.
  • See how to use multithreading and multiprocessing for modeling certain types of problems.
  • Develop programs with python that are highly concurrent and parallel.
  • Understand the advantages, limits and properties of parallel computing.
  • Improve your programming skills in python with more advanced, mulithreading and multiprocessing topics.
  • Learn about threads, processes, mutexes, barriers, waitgroups, queues, pipes, condition variables, deadlocks and more.

Syllabus

Introduction
Understanding Parallel Computing
More on Parallel Computing
Links and Resources for this course
Read more
Creating Threads and Processes
Processes and Threads
Threads in Python and the GIL (Global Interpreter Lock)
Creating our first Thread
Processes in Python
Creating our first Processes
Memory Sharing between Threads
Memory Sharing
Letter count Implementation
Letter count using Memory Sharing
Thread Synchronization with Mutexes
Why do we need Synchronization?
Adding Mutexes to Letter Count
Adding Mutexes to Letter Count Implementation
Waiting for Completed tasks using Joins
Understanding Joins
File Search Example
Concurrent File Search
Synchronization using Condition Variables
Introduction to Condition Variables
Condition Variables for Wait Groups
Implementing Wait Groups with Condition Variables
Using Wait Groups
Barriers Explained
What’s a Barrier?
Example Barrier Application: Matrix Multiplication
Matrix Multiplication Implementation
Multi Threaded Matrix Multiplication with Barriers
Multi Threaded implementation with Barriers
Memory Sharing between Processes
How can Processes share Memory?
Using Process Memory Sharing
Process Memory Sharing in Practice
Communication using Message passing
Communication with Pipes and Queues
Examples of using Pipes and Queues
Pipelining Example
Single Process implementation
Multi Process implementation
Thread and Process Pools
Process Pool Example Part 1
Process Pool Example Part 2
Shoelace algorithm explained (optional)
Avoiding Deadlocks
Deadlocking Robots, Philosophers and Trains
Simple Deadlock Example
Train Deadlock Example Part 1
Train Deadlock Example Part 2
Solving Deadlocks using Resource Hierarchy
Implementing Resource Hierarchy Solution
Solving Deadlocks using an Arbitrator
Implementing Arbitrator Solution

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Teaches multithreading and multiprocessing, which are essential for creating high performance software
Uses Python, which is a popular programming language used in industry
Provides practical examples and hands-on exercises
Requires students to have some experience with programming
Covers a wide range of topics, from basic concepts to advanced techniques
Taught by instructors with industry experience

Save this course

Save Learn Parallel Computing in Python to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Learn Parallel Computing in Python with these activities:
Read 'Concurrency in Practice'
This book provides a comprehensive overview of concurrency and multithreading in Java. It's a valuable resource for anyone who wants to learn more about these topics.
Show steps
  • Read the book thoroughly.
  • Work through the exercises in the book.
  • Apply the concepts you learn to your own projects.
Learn about mutexes and semaphores
Mutexes and semaphores are essential tools for preventing race conditions in multithreaded programs. Learn how to use them effectively.
Browse courses on Mutexes
Show steps
  • Read a tutorial or watch a video on mutexes and semaphores.
  • Write a simple program that demonstrates how to use mutexes to protect a shared variable.
  • Write a simple program that demonstrates how to use semaphores to control access to a shared resource.
Practice coding race conditions
Practice writing code that creates race conditions to better understand how to detect and prevent them.
Browse courses on Race Conditions
Show steps
  • Create a simple multithreaded program that shares a variable between threads.
  • Run the program and observe the different outcomes.
  • Modify the program to add synchronization mechanisms to prevent race conditions.
  • Test the modified program and verify that it runs correctly.
Five other activities
Expand to see all activities and additional details
Show all eight activities
Mentor a junior developer on concurrency topics
Mentoring others will help you to solidify your understanding of concurrency and share your knowledge with others.
Browse courses on Concurrency
Show steps
  • Find a junior developer who is interested in learning about concurrency.
  • Meet with the developer regularly to discuss concurrency topics.
  • Answer the developer's questions and provide guidance.
  • Help the developer to develop a project that uses concurrency.
Develop a multithreaded application
Building a multithreaded application will give you hands-on experience with the challenges and benefits of concurrency.
Browse courses on Multithreading
Show steps
  • Choose a project idea that can benefit from multithreading.
  • Design the architecture of your application, including how you will handle concurrency.
  • Implement your application using multithreading.
  • Test your application and identify any concurrency issues.
  • Deploy your application and monitor its performance.
Contribute to an open-source project that uses concurrency
Contributing to an open-source project will give you hands-on experience with concurrency and help you to learn from others.
Browse courses on Concurrency
Show steps
  • Find an open-source project that uses concurrency.
  • Read the project's documentation and learn about its architecture.
  • Identify an area where you can contribute.
  • Make a pull request to the project.
  • Collaborate with the project's maintainers to get your changes merged.
Write a blog post about race conditions
Writing a blog post about race conditions will help you to solidify your understanding of the topic and share your knowledge with others.
Browse courses on Race Conditions
Show steps
  • Choose a specific aspect of race conditions to focus on.
  • Research the topic and gather information.
  • Write a detailed blog post that explains the topic clearly.
  • Publish your blog post and share it with others.
Participate in a coding competition that focuses on concurrency
Participating in a coding competition will test your skills in concurrency and help you to learn from others.
Browse courses on Concurrency
Show steps
  • Find a coding competition that focuses on concurrency.
  • Register for the competition and prepare for it.
  • Compete in the competition and do your best.
  • Review your performance and identify areas for improvement.

Career center

Learners who complete Learn Parallel Computing in Python will develop knowledge and skills that may be useful to these careers:
Software Engineer
Software Engineers apply engineering principles to the design, development, and maintenance of software systems. They work with a variety of software development tools and technologies to create and maintain software applications. This course provides Software Engineers with the skills they need to develop more efficient and scalable software systems. By understanding how to use multithreading and multiprocessing, Software Engineers can design and implement systems that can handle a high volume of traffic and provide a better user experience.
Computer Scientist
Computer Scientists study the theory and practice of computation. They work with a variety of computational tools and techniques to solve problems in a wide variety of fields, including artificial intelligence, machine learning, and data science. This course provides Computer Scientists with the skills they need to develop more efficient and scalable algorithms. By understanding how to use multithreading and multiprocessing, Computer Scientists can design and implement algorithms that can run faster and more efficiently on multiple processors.
Software Developer
Software Developers are responsible for analyzing user needs and designing, creating, modifying, and testing software applications. They work across industries to build and maintain software systems that meet specific business needs. This course provides a strong foundation in multithreading and multiprocessing, which are essential skills for Software Developers who want to create responsive and high-performance software. By understanding how to use these techniques, Software Developers can develop more efficient and scalable applications.
Computer Programmer
Computer Programmers write, test, and maintain the code that makes software and applications run. They work closely with Software Developers to translate designs and specifications into functional code. This course provides Computer Programmers with the skills they need to develop concurrent and parallel programs, which can improve the performance and efficiency of software applications.
Research Scientist
Research Scientists conduct research in a variety of fields, including science, engineering, and medicine. They work with a variety of tools and techniques to investigate new phenomena and develop new solutions to problems. This course provides Research Scientists with the skills they need to develop more efficient and scalable research pipelines. By understanding how to use multithreading and multiprocessing, Research Scientists can analyze data faster and more efficiently, which can lead to new discoveries and insights.
Computational Scientist
Computational Scientists use computers to solve scientific problems. They work with a variety of scientific models and simulations to study a wide range of phenomena, including climate change, weather forecasting, and drug discovery. This course provides Computational Scientists with the skills they need to develop more efficient and scalable scientific simulations. By understanding how to use multithreading and multiprocessing, Computational Scientists can run simulations faster and more efficiently, which can lead to better scientific insights and discoveries.
Web Developer
Web Developers design, create, and maintain websites. They work with a variety of technologies to ensure that websites are functional, accessible, and visually appealing. This course provides Web Developers with the skills they need to develop more responsive and interactive websites. By understanding how to use multithreading and multiprocessing, Web Developers can create websites that can handle a high volume of traffic and provide a better user experience.
Systems Analyst
Systems Analysts design, develop, and implement computer systems. They work with a variety of stakeholders to understand their needs and develop solutions that meet their requirements. This course provides Systems Analysts with the skills they need to develop more efficient and scalable systems. By understanding how to use multithreading and multiprocessing, Systems Analysts can design and implement systems that can handle a high volume of traffic and provide a better user experience.
Network Administrator
Network Administrators design, implement, and maintain computer networks. They work with a variety of network technologies to ensure that networks are reliable, secure, and efficient. This course provides Network Administrators with the skills they need to develop more efficient and scalable networks. By understanding how to use multithreading and multiprocessing, Network Administrators can manage networks faster and more efficiently, which can lead to better performance and reliability.
Machine Learning Engineer
Machine Learning Engineers design, develop, and deploy machine learning models. They work with a variety of data sources and algorithms to create models that can solve specific business problems. This course provides Machine Learning Engineers with the skills they need to develop more efficient and scalable machine learning models. By understanding how to use multithreading and multiprocessing, Machine Learning Engineers can train models faster and more efficiently, which can lead to better results.
Business Analyst
Business Analysts help businesses understand their needs and develop solutions to improve their operations. They work with a variety of stakeholders to gather requirements, analyze data, and recommend solutions. This course provides Business Analysts with the skills they need to develop more efficient and scalable business analysis processes. By understanding how to use multithreading and multiprocessing, Business Analysts can analyze data faster and more efficiently, which can lead to better insights and decision-making.
Data Analyst
Data Analysts collect, analyze, and interpret data to help businesses make informed decisions. They work with a variety of tools and techniques to identify trends and patterns in data. This course provides Data Analysts with the skills they need to develop more efficient and scalable data analysis pipelines. By understanding how to use multithreading and multiprocessing, Data Analysts can process data faster and more efficiently, which can lead to better insights and decision-making.
Database Administrator
Database Administrators design, implement, and maintain databases. They work with a variety of databases and technologies to ensure that data is stored, managed, and accessed efficiently. This course provides Database Administrators with the skills they need to develop more efficient and scalable database systems. By understanding how to use multithreading and multiprocessing, Database Administrators can manage data faster and more efficiently, which can lead to better performance and reliability.
Data Scientist
Data Scientists use data to solve business problems. They work with a variety of tools and techniques to collect, analyze, and interpret data. This course provides Data Scientists with the skills they need to develop more efficient and scalable data processing pipelines. By understanding how to use multithreading and multiprocessing, Data Scientists can process data faster and more efficiently, which can lead to better insights and decision-making.
Information Security Analyst
Information Security Analysts design, implement, and maintain security measures to protect computer systems and networks. They work with a variety of security technologies to ensure that systems and networks are protected from unauthorized access and cyberattacks. This course provides Information Security Analysts with the skills they need to develop more efficient and scalable security systems. By understanding how to use multithreading and multiprocessing, Information Security Analysts can analyze security data faster and more efficiently, which can lead to better detection and prevention of cyberattacks.

Reading list

We've selected eight books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Learn Parallel Computing in Python.
Provides a comprehensive overview of concurrency, covering topics such as thread synchronization, lock-free programming, and distributed computing. It valuable resource for readers who want to learn more about the theory and practice of concurrency.
Provides a comprehensive overview of scalable parallel computing, covering topics such as parallel algorithms, parallel architectures, and performance analysis. It valuable resource for readers who want to learn more about the theory and practice of scalable parallel computing.
Provides a comprehensive overview of parallel programming, covering topics such as parallel algorithms, parallel architectures, and performance analysis. It valuable resource for readers who want to learn more about the theory and practice of parallel programming.
Provides a deep dive into parallel computer architecture, focusing on both hardware and software aspects. It covers topics like processor design, memory systems, and network topologies, offering a comprehensive understanding of the underlying infrastructure for parallel computing.
Provides a concise and accessible introduction to semaphores, a fundamental synchronization primitive in concurrent programming. It explains semaphore concepts and their applications in a clear and practical way.
Provides a comprehensive and rigorous treatment of concurrent programming. It covers fundamental concepts like mutual exclusion, synchronization, and fault tolerance, offering a deep understanding of the theoretical foundations of concurrent programming.
Provides a hands-on approach to programming massively parallel processors. It covers topics like CUDA programming, OpenMP, and MPI, enabling readers to develop efficient and scalable parallel applications for high-performance computing.
Provides a detailed introduction to OpenMP, a widely used parallel programming model. It covers topics like thread management, data sharing, and performance optimization, offering a valuable resource for developing parallel applications using OpenMP.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Learn Parallel Computing in Python.
Complete Guide to Python Multithreading and...
Most relevant
Mastering Multithreading Programming with Go (Golang)
Most relevant
Mastering Multithreading with Go
Most relevant
Java Multithreading, Concurrency & Performance...
Most relevant
Python Programming - Multithreading, OOP, NumPy and Pandas
Most relevant
Android Multithreading Masterclass
Concurrent Programming in Java
Concurrent Programming in Go
Master Network Automation with Python for Network...
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser