Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Example: Bank Account Program

Give Feedback

In this lesson, you’ll create a bank account program that demonstrates a race condition. If you download the sample code, you can get your own copy of 09-account.py:

Download

Sample Code (.zip)

12.9 KB

To learn more, you can also check out the documentation for concurrent.futures.Executor.submit as well as the software section of the Wikipedia page on race conditions.

Comments & Discussion

fiy the wikipedia links to the Executor.submit python doc

malbert137 on June 1, 2020

Presumably at the exit of the context manager, the thread pool joins all of the “submitted” threads?

Become a Member to join the conversation.